5
5
- master
6
6
permissions : write-all
7
7
jobs :
8
- build :
9
- name : Build
8
+ metadata :
9
+ name : Get release metadata
10
10
runs-on : ubuntu-latest
11
11
outputs :
12
12
version : ${{ steps.get_version.outputs.version }}
15
15
- name : Checkout code
16
16
uses : actions/checkout@v4
17
17
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
-
45
18
- name : Get version
46
19
id : get_version
47
20
run : echo "version=$(cargo read-manifest | jq -r '.version')" >> $GITHUB_OUTPUT
@@ -61,21 +34,39 @@ jobs:
61
34
fi
62
35
63
36
release :
64
- name : Release
37
+ name : Build and release
65
38
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'
68
41
steps :
69
42
- name : Checkout code
70
43
uses : actions/checkout@v4
71
44
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
74
65
75
66
- name : Create GitHub Release
76
67
uses : softprops/action-gh-release@v2
77
68
with :
78
- tag_name : ${{ needs.build .outputs.version }}
69
+ tag_name : ${{ needs.metadata .outputs.version }}
79
70
files : |
80
71
README.md
81
72
artifacts/*
0 commit comments