@@ -13,17 +13,28 @@ jobs:
1313 runs-on : ${{ matrix.os }}
1414 strategy :
1515 matrix :
16- os : [ubuntu-latest, windows-latest, macos-latest ]
16+ target : [x86_64-unknown-linux-gnu, x86_64-pc- windows-gnu, x86_64-apple-darwin, armv7-unknown-linux-gnueabihf ]
1717 include :
18- - os : ubuntu-latest
18+ - target : x86_64-unknown-linux-gnu
19+ os : ubuntu-latest
1920 artifact_name : cryptography-learning-backend
2021 release_name : cryptography-learning-backend-linux-ubuntu-amd64
21- - os : windows-latest
22+ use_cross : false
23+ - target : x86_64-pc-windows-gnu
24+ os : windows-latest
2225 artifact_name : cryptography-learning-backend.exe
2326 release_name : cryptography-learning-backend-windows-amd64.exe
24- - os : macos-latest
27+ use_cross : false
28+ - target : x86_64-apple-darwin
29+ os : macos-latest
2530 artifact_name : cryptography-learning-backend
2631 release_name : cryptography-learning-backend-macos-amd64
32+ use_cross : false
33+ - target : armv7-unknown-linux-gnueabihf
34+ os : ubuntu-latest
35+ artifact_name : cryptography-learning-backend
36+ release_name : cryptography-learning-backend-linux-armv7-gnueabihf
37+ use_cross : true
2738
2839 steps :
2940 - uses : actions/checkout@v2
@@ -32,49 +43,22 @@ jobs:
3243 toolchain : stable
3344 target : ${{ matrix.target }}
3445 override : true
35- with :
36- toolchain : stable
37- target : ${{ matrix.target }}
38- override : true
3946 - uses : Swatinem/rust-cache@v2
4047 - uses : actions-rs/cargo@v1
4148 with :
42- use-cross : true
43- command : build
44- args : --release
45- - name : Upload binaries to release
46- uses : svenstaro/upload-release-action@v1-release
47- with :
48- repo_token : ${{ secrets.GITHUB_TOKEN }}
49- file : target/release/${{ matrix.artifact_name }}
50- asset_name : ${{ matrix.release_name }}
51- tag : ${{ github.ref }}
52-
53- cross-compile-publish :
54- name : Cross Compile Publish
55- runs-on : ubuntu-latest
56- strategy :
57- matrix :
58- target :
59- - armv7-unknown-linux-gnueabihf
60- steps :
61- - uses : actions/checkout@v2
62- - uses : actions-rs/toolchain@v1
63- with :
64- toolchain : stable
65- target : ${{ matrix.target }}
66- override : true
49+ use-cross : ${{ matrix.use_cross }}
50+ command : test
6751 - uses : actions-rs/cargo@v1
6852 with :
69- use-cross : true
53+ use-cross : ${{ matrix.use_cross }}
7054 command : build
7155 args : --release --target=${{ matrix.target }}
7256 - name : Upload binaries to release
7357 uses : svenstaro/upload-release-action@v1-release
7458 with :
7559 repo_token : ${{ secrets.GITHUB_TOKEN }}
76- file : target/${{ matrix.target }}/release/cryptography-learning-backend
77- asset_name : cryptography-learning-backend- ${{ matrix.target }}
60+ file : target/${{ matrix.target }}/release/${{ matrix.artifact_name }}
61+ asset_name : ${{ matrix.release_name }}
7862 tag : ${{ github.ref }}
7963
8064 static-compile-publish :
8872 - uses : actions/checkout@v2
8973 - name : Static build
9074 uses : zhxiaogg/cargo-static-build@master
75+ with :
76+ cmd : cargo build --release
9177 - uses : svenstaro/upload-release-action@v1-release
9278 with :
9379 repo_token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments