Commit 3ce2b57 1 parent f29d1f3 commit 3ce2b57 Copy full SHA for 3ce2b57
File tree 1 file changed +46
-9
lines changed
1 file changed +46
-9
lines changed Original file line number Diff line number Diff line change 1
- name : Rust
1
+ name : Rust Build and Release
2
2
3
3
on :
4
4
push :
5
5
branches : [ "master" ]
6
- pull_request :
7
- branches : [ "master" ]
6
+
8
7
9
8
env :
10
9
CARGO_TERM_COLOR : always
11
10
12
11
jobs :
13
12
build :
14
-
15
- runs-on : ubuntu-latest
13
+ name : Build on ${{ matrix.os }}
14
+ runs-on : ${{ matrix.os }}
15
+ strategy :
16
+ matrix :
17
+ os : [ ubuntu-latest, windows-latest, macos-latest ]
18
+ include :
19
+ - os : ubuntu-latest
20
+ target : x86_64-unknown-linux-gnu
21
+ - os : windows-latest
22
+ target : x86_64-pc-windows-msvc
23
+ - os : macos-latest
24
+ target : x86_64-apple-darwin
16
25
17
26
steps :
18
- - uses : actions/checkout@v4
19
- - name : Build
20
- run : cargo build --release --verbose
21
-
27
+ - uses : actions/checkout@v4
28
+
29
+ - name : Install Rust
30
+ uses : actions-rs/toolchain@v1
31
+ with :
32
+ toolchain : stable
33
+ target : ${{ matrix.target }}
34
+ override : true
35
+
36
+ - name : Build
37
+ uses : actions-rs/cargo@v1
38
+ with :
39
+ command : build
40
+ args : --release --target ${{ matrix.target }}
41
+
42
+ - name : Package Binary
43
+ shell : bash
44
+ run : |
45
+ binary_name="merklemap_cli"
46
+ if [ "${{ matrix.os }}" = "windows-latest" ]; then
47
+ binary_name="${binary_name}.exe"
48
+ fi
49
+ tar -czf "${binary_name}-${{ matrix.target }}.tar.gz" -C "target/${{ matrix.target }}/release" "${binary_name}"
50
+
51
+ - name : Release
52
+ uses : softprops/action-gh-release@v1
53
+ if : startsWith(github.ref, 'refs/tags/')
54
+ with :
55
+ files : |
56
+ merklemap_cli-${{ matrix.target }}.tar.gz
57
+ env :
58
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments