-
Notifications
You must be signed in to change notification settings - Fork 285
94 lines (77 loc) · 2.42 KB
/
cd.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: CD
on:
release:
types: [published]
env:
CARGO_TERM_COLOR: always
jobs:
deploy:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Build Release
run: make build
- name: Package release for Mac
if: matrix.os == 'macos-latest'
run: make release-mac
- name: Package release for Linux
if: matrix.os == 'ubuntu-latest'
run: make release-linux
- name: Package release for Windows
if: matrix.os == 'windows-latest'
run: make release-win
- name: Publish to GitHub
uses: softprops/action-gh-release@v2
with:
files: |
./release/*.tar.gz
./release/*.zip
./onefetch-setup.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to Homebrew
uses: mislav/bump-homebrew-formula-action@v3
if: matrix.os == 'macos-latest'
env:
COMMITTER_TOKEN: ${{ secrets.BREW_TOKEN }}
with:
formula-name: onefetch
- name: Publish to WinGet
uses: vedantmgoyal9/winget-releaser@main
if: matrix.os == 'windows-latest'
with:
identifier: o2sh.onefetch
installers-regex: '\.exe$'
version: ${{ github.event.release.tag_name }}
token: ${{ secrets.WINGET_TOKEN }}
crates:
name: Publish to crates.io
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Publish to crates.io (ascii)
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo publish -p onefetch-ascii
- name: Publish to crates.io (image)
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo publish -p onefetch-image
- name: Publish to crates.io (manifest)
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo publish -p onefetch-manifest
- name: Publish to crates.io
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo publish