55 - master
66permissions : write-all
77jobs :
8- build :
9- name : Build
8+ metadata :
9+ name : Get release metadata
1010 runs-on : ubuntu-latest
1111 outputs :
1212 version : ${{ steps.get_version.outputs.version }}
1515 - name : Checkout code
1616 uses : actions/checkout@v4
1717
18- - name : Setup rust toolchain
19- run : rustup toolchain install stable --profile minimal
20-
21- - name : Setup rust cache
22- uses : Swatinem/rust-cache@v2
23-
24- - name : Install cross
25- run : cargo install cross --version 0.2.5
26-
27- - name : Build for Intel Linux
28- run : cargo build --release --target=x86_64-unknown-linux-gnu
29-
30- - name : Build for ARM Linux
31- run : cross build --release --target=armv7-unknown-linux-gnueabihf
32-
33- - name : Create artifacts directory
34- run : |
35- mkdir -p artifacts
36- cp target/x86_64-unknown-linux-gnu/release/relay-server artifacts/relay-server-x86_64-unknown-linux
37- cp target/armv7-unknown-linux-gnueabihf/release/relay-server artifacts/relay-server-armv7-unknown-linux
38-
39- - name : Upload job artifacts
40- uses : actions/upload-artifact@v4
41- with :
42- name : artifacts
43- path : artifacts/
44-
4518 - name : Get version
4619 id : get_version
4720 run : echo "version=$(cargo read-manifest | jq -r '.version')" >> $GITHUB_OUTPUT
@@ -61,21 +34,39 @@ jobs:
6134 fi
6235
6336 release :
64- name : Release
37+ name : Build and release
6538 runs-on : ubuntu-latest
66- needs : build
67- if : needs.build .outputs.release_exists == 'false'
39+ needs : metadata
40+ if : needs.metadata .outputs.release_exists == 'false'
6841 steps :
6942 - name : Checkout code
7043 uses : actions/checkout@v4
7144
72- - name : Download job artifacts
73- uses : actions/download-artifact@v4
45+ - name : Setup rust toolchain
46+ run : rustup toolchain install stable --profile minimal
47+
48+ - name : Setup rust cache
49+ uses : Swatinem/rust-cache@v2
50+
51+ - name : Install cross
52+ run : cargo install cross --version 0.2.5
53+
54+ - name : Build for Intel Linux
55+ run : cargo build --release --target=x86_64-unknown-linux-gnu
56+
57+ - name : Build for ARM Linux
58+ run : cross build --release --target=armv7-unknown-linux-gnueabihf
59+
60+ - name : Create artifacts directory
61+ run : |
62+ mkdir -p artifacts
63+ cp target/x86_64-unknown-linux-gnu/release/relay-server artifacts/relay-server-x86_64-unknown-linux
64+ cp target/armv7-unknown-linux-gnueabihf/release/relay-server artifacts/relay-server-armv7-unknown-linux
7465
7566 - name : Create GitHub Release
7667 uses : softprops/action-gh-release@v2
7768 with :
78- tag_name : ${{ needs.build .outputs.version }}
69+ tag_name : ${{ needs.metadata .outputs.version }}
7970 files : |
8071 README.md
8172 artifacts/*
0 commit comments