Skip to content

Commit a727af0

Browse files
committed
ci: fix linux arm64 release build
1 parent 647cee8 commit a727af0

1 file changed

Lines changed: 13 additions & 10 deletions

File tree

.github/workflows/release.yml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,16 @@ jobs:
1515
include:
1616
- os: ubuntu-latest
1717
target: x86_64-unknown-linux-gnu
18+
use_cross: false
1819
- os: ubuntu-latest
1920
target: aarch64-unknown-linux-gnu
20-
needs_cross: true
21+
use_cross: true
2122
- os: macos-13
2223
target: x86_64-apple-darwin
24+
use_cross: false
2325
- os: macos-14
2426
target: aarch64-apple-darwin
27+
use_cross: false
2528

2629
runs-on: ${{ matrix.os }}
2730
steps:
@@ -30,17 +33,17 @@ jobs:
3033
with:
3134
targets: ${{ matrix.target }}
3235

33-
- name: Install Linux cross toolchain
34-
if: matrix.needs_cross
35-
run: |
36-
sudo apt-get update
37-
sudo apt-get install -y gcc-aarch64-linux-gnu
36+
- name: Install cross
37+
if: matrix.use_cross
38+
run: cargo install cross --locked
3839

3940
- name: Build
40-
env:
41-
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
42-
CC_aarch64_unknown_linux_gnu: aarch64-linux-gnu-gcc
43-
run: cargo build --locked --release --target ${{ matrix.target }}
41+
run: |
42+
if [ "${{ matrix.use_cross }}" = "true" ]; then
43+
cross build --locked --release --target ${{ matrix.target }}
44+
else
45+
cargo build --locked --release --target ${{ matrix.target }}
46+
fi
4447
4548
- name: Package
4649
run: |

0 commit comments

Comments
 (0)