3
3
push :
4
4
tags :
5
5
- ' *'
6
+
7
+ permissions :
8
+ contents : write
9
+
6
10
jobs :
7
11
publish :
8
- runs-on : ubuntu-latest
9
- permissions :
10
- contents : write
12
+ name : Publish release
13
+ runs-on : ${{ matrix.os }}
14
+
15
+ strategy :
16
+ fail-fast : false
17
+ matrix :
18
+ include :
19
+ - build : linux-x86_64
20
+ os : ubuntu-latest
21
+ target : x86_64-unknown-linux-gnu
22
+ - build : linux-aarch64
23
+ os : ubuntu-latest
24
+ target : aarch64-unknown-linux-gnu
25
+
26
+ - build : macos-x86_64
27
+ os : macos-latest
28
+ target : x86_64-apple-darwin
29
+ - build : macos-aarch64
30
+ os : macos-latest
31
+ target : aarch64-apple-darwin
32
+
33
+ - build : windows-x86_64
34
+ os : windows-latest
35
+ target : x86_64-pc-windows-msvc
36
+
11
37
steps :
12
38
- name : Clone project
13
39
uses : actions/checkout@v4
14
- - name : Setup MinGW
15
- uses : egor-tensin/setup-mingw@v2.2.0
16
- - name : Setup GCC
17
- uses : egor-tensin/setup-gcc@v1.3
40
+
18
41
- name : Setup Rust
19
- run : |
20
- rustup default stable
21
- rustup target add x86_64-pc-windows-gnu
42
+ uses : dtolnay/rust-toolchain@stable
43
+ with :
44
+ targets : ${{ matrix.target }}
45
+
22
46
- name : Build project
23
- run : cargo build --target x86_64-pc-windows-gnu --release && cargo build --release
24
- - name : Publish release
25
- uses : ghalactic/github-release-from-tag@v5
47
+ uses : actions-rs/cargo@v1.0.1
48
+ with :
49
+ use-cross : true
50
+ command : build
51
+ args : --verbose --release --target ${{ matrix.target }}
52
+
53
+ - name : Make asset
54
+ shell : bash
55
+ run : |
56
+ name="client-${{ matrix.target }}"
57
+ if [ "${{ matrix.os }}" = "windows-latest" ]; then
58
+ mv "target/${{ matrix.target }}/release/client.exe" "$name.exe"
59
+ echo "ASSET=$name.exe" >> $GITHUB_ENV
60
+ else
61
+ mv "target/${{ matrix.target }}/release/client" "$name"
62
+ echo "ASSET=$name" >> $GITHUB_ENV
63
+ fi
64
+
65
+ - name :
66
+ uses : softprops/action-gh-release@v1
26
67
with :
27
- generateReleaseNotes : " true"
28
- prerelease : " false"
29
- assets : |
30
- - path: target/release/client
31
- name: client-linux
32
- - path: target/x86_64-pc-windows-gnu/release/client.exe
33
- name: client-windows.exe
68
+ files : |
69
+ ${{ env.ASSET }}
0 commit comments