1+ name : Build and Release
2+
3+ on :
4+ push :
5+ tags :
6+ - ' v*' # Trigger on version tags (v1.0.0, etc.)
7+
8+ permissions :
9+ contents : write
10+
11+ jobs :
12+ build :
13+ name : Build
14+ runs-on : ${{ matrix.os }}
15+ strategy :
16+ matrix :
17+ include :
18+ - os : macos-latest
19+ artifact_name : rs-wavelog-gate-macos
20+ asset_name : rs-wavelog-gate
21+ - os : windows-latest
22+ artifact_name : rs-wavelog-gate-windows
23+ asset_name : rs-wavelog-gate.exe
24+
25+ steps :
26+ - uses : actions/checkout@v4
27+ - name : Cache
28+ uses : actions/cache@v4
29+ with :
30+ path : |
31+ ~/.cargo/bin/
32+ ~/.cargo/registry/index/
33+ ~/.cargo/registry/cache/
34+ ~/.cargo/git/db/
35+ target/
36+ key : ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
37+ - name : Build
38+ run : cargo build --profile release
39+
40+ - name : Upload
41+ uses : actions/upload-artifact@v4
42+ with :
43+ name : ${{ matrix.artifact_name }}
44+ path : target/release/${{ matrix.asset_name }}
45+
46+ release :
47+ name : Release
48+ runs-on : ubuntu-latest
49+ needs : build
50+ steps :
51+ - uses : actions/checkout@v4
52+ - name : Download artifact
53+ uses : actions/download-artifact@v4
54+ - run : |
55+ chmod +x ./rs-wavelog-gate-macos/rs-wavelog-gate
56+ chmod +x ./rs-wavelog-gate-windows/rs-wavelog-gate.exe
57+ tar -czf rs-wavelog-gate-macos.tar.gz rs-wavelog-gate-macos/rs-wavelog-gate
58+ tar -czf rs-wavelog-gate-windows.tar.gz rs-wavelog-gate-windows/rs-wavelog-gate.exe
59+ - name : Publish built binary to GitHub releases
60+ run : |
61+ gh release create ${{ github.ref_name }} \
62+ --generate-notes \
63+ rs-wavelog-gate-macos.tar.gz#macOS \
64+ rs-wavelog-gate-windows.tar.gz#Windows
65+ env :
66+ GH_TOKEN : ${{ github.token }}
67+
68+
69+
0 commit comments