1+ # https://github.com/svenstaro/proxyboi/blob/fd1b493d2c2a341205d669cbf6bd549c5731df63/.github/workflows/publish.yml
2+
3+ on :
4+ push :
5+ tags :
6+ - ' v*.*.*'
7+
8+ name : Publish
9+
10+ jobs :
11+ publish :
12+ name : Publish
13+ runs-on : ${{ matrix.os }}
14+ strategy :
15+ matrix :
16+ os : [ubuntu-latest, windows-latest, macos-latest]
17+ include :
18+ - os : ubuntu-latest
19+ artifact_name : slp-server-rust
20+ release_name : slp-server-rust-linux-amd64
21+ - os : windows-latest
22+ artifact_name : slp-server-rust.exe
23+ release_name : slp-server-rust-windows-amd64.exe
24+ - os : macos-latest
25+ artifact_name : slp-server-rust
26+ release_name : slp-server-rust-macos-amd64
27+
28+ steps :
29+ - uses : actions/checkout@v2
30+
31+ - uses : actions-rs/toolchain@v1
32+ with :
33+ toolchain : stable
34+ target : ${{ matrix.target }}
35+ override : true
36+
37+ - uses : actions-rs/cargo@v1
38+ with :
39+ use-cross : true
40+ command : build
41+ args : --release
42+
43+ - name : Upload binaries to release
44+ uses : svenstaro/upload-release-action@v1-release
45+ with :
46+ repo_token : ${{ secrets.GITHUB_TOKEN }}
47+ file : target/release/${{ matrix.artifact_name }}
48+ asset_name : ${{ matrix.release_name }}
49+ tag : ${{ github.ref }}
50+
51+ cross_compile_publish :
52+ name : Cross compile publish
53+ runs-on : ubuntu-latest
54+ strategy :
55+ matrix :
56+ target :
57+ - armv7-unknown-linux-gnueabihf
58+ steps :
59+ - uses : actions/checkout@v2
60+ - uses : actions-rs/toolchain@v1
61+ with :
62+ toolchain : stable
63+ target : ${{ matrix.target }}
64+ override : true
65+ - uses : actions-rs/cargo@v1
66+ with :
67+ use-cross : true
68+ command : build
69+ args : --release --target=${{ matrix.target }}
70+ - name : Upload binaries to release
71+ uses : svenstaro/upload-release-action@v1-release
72+ with :
73+ repo_token : ${{ secrets.GITHUB_TOKEN }}
74+ file : target/${{ matrix.target }}/release/slp-server-rust
75+ asset_name : slp-server-rust-${{ matrix.target }}
76+ tag : ${{ github.ref }}
0 commit comments