Skip to content

Commit a2e6be5

Browse files
committed
refactor GitHub Actions workflow to use OS matrix for builds and rust nightly
1 parent 8767eb2 commit a2e6be5

File tree

1 file changed

+27
-16
lines changed

1 file changed

+27
-16
lines changed

.github/workflows/build-binaries.yml

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,39 @@ on:
88

99
jobs:
1010
build:
11-
runs-on: ${{ matrix.target }}
11+
runs-on: ${{ matrix.os }}
1212
strategy:
1313
matrix:
14-
target:
15-
- x86_64-unknown-linux-gnu
16-
- aarch64-apple-darwin
17-
- x86_64-pc-windows-msvc
14+
include:
15+
- os: ubuntu-latest
16+
target: x86_64-unknown-linux-gnu
17+
- os: macos-latest
18+
target: aarch64-apple-darwin
19+
- os: windows-latest
20+
target: x86_64-pc-windows-msvc
21+
1822
steps:
1923
- uses: actions/checkout@v4
20-
- name: Install Rust toolchain
24+
25+
- name: Install Rust toolchain -- nightly
2126
uses: actions-rs/toolchain@v1
22-
with:
23-
toolchain: stable
24-
target: ${{ matrix.target }}
25-
override: true
26-
- name: Install build dependencies
27-
run: |
28-
sudo apt-get update
29-
sudo apt-get install -y build-essential pkg-config libssl-dev
30-
if: matrix.target == 'x86_64-unknown-linux-gnu'
27+
run:
28+
rustup update nightly
29+
rustup default nightly
30+
rustup target add ${{ matrix.target }}
31+
32+
# - name: Install build dependencies
33+
# if: matrix.target == 'x86_64-unknown-linux-gnu'
34+
# run: |
35+
# sudo apt-get update
36+
# sudo apt-get install -y build-essential pkg-config libssl-dev
37+
3138
- name: Build for ${{ matrix.target }}
32-
run: cargo build --release --target ${{ matrix.target }}
39+
uses: actions-rs/cargo@v1
40+
with:
41+
command: build
42+
args: --release --target ${{ matrix.target }}
43+
3344
- name: Upload artifacts
3445
uses: actions/upload-artifact@v4
3546
with:

0 commit comments

Comments
 (0)