on main help sign in
Add macOS cross-compilation to release action
5ede2a6fabianlindfors
.github/workflows/release.yaml+12−3
@@ -8,8 +8,15 @@ env:
8 CARGO_TERM_COLOR: always
8 CARGO_TERM_COLOR: always
9
9
10jobs:
10jobs:
11− build-linux-amd64:
11+ build-binary:
12 runs-on: ubuntu-latest
12 runs-on: ubuntu-latest
13+ strategy:
14+ matrix:
15+ include:
16+ - name: linux_amd64
17+ target: x86_64-unknown-linux-gnu
18+ - name: macos_amd64
19+ target: x86_64-apple-darwin
13 steps:
20 steps:
14 - name: Checkout
21 - name: Checkout
15 uses: actions/checkout@v2
22 uses: actions/checkout@v2
@@ -17,6 +24,7 @@ jobs:
17 uses: actions-rs/toolchain@v1
24 uses: actions-rs/toolchain@v1
18 with:
25 with:
19 toolchain: stable
26 toolchain: stable
27+ target: ${{ matrix.target }}
20 - name: Use cache for Rust dependencies
28 - name: Use cache for Rust dependencies
21 uses: Swatinem/rust-cache@v1
29 uses: Swatinem/rust-cache@v1
22 - name: Build
30 - name: Build
@@ -24,14 +32,15 @@ jobs:
24 with:
32 with:
25 command: build
33 command: build
26 args: --release
34 args: --release
35+ use-cross: true
27 - name: Rename binary
36 - name: Rename binary
28− run: mv target/release/reshape ./reshape-linux_amd64
37+ run: mv target/release/reshape ./reshape-${{ matrix.name }}
29 - name: Save binary to release
38 - name: Save binary to release
30 uses: skx/github-action-publish-binaries@master
39 uses: skx/github-action-publish-binaries@master
31 env:
40 env:
32 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33 with:
42 with:
34− args: reshape-linux_amd64
43+ args: reshape-${{ matrix.name }}
35
44
36 publish-docker:
45 publish-docker:
37 runs-on: ubuntu-latest
46 runs-on: ubuntu-latest