Skip to content

Commit a6fd34f

Browse files
authored
Build ARM binaries for Linux (#151)
1 parent 1071fbc commit a6fd34f

File tree

1 file changed

+23
-7
lines changed

1 file changed

+23
-7
lines changed

.github/workflows/build-for-release.yml

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,37 +9,53 @@ jobs:
99
runs-on: ${{ matrix.os }}
1010
strategy:
1111
matrix:
12-
os: [ubuntu-latest, windows-latest, macos-latest]
12+
build_name:
13+
[linux-x64-musl, linux-arm64-musl, macos-arm64, windows-x64-msvc]
1314
include:
14-
- os: ubuntu-latest
15+
- build_name: linux-x64-musl
16+
os: ubuntu-latest
1517
exe_suffix: ""
1618
name_suffix: ""
1719
target: x86_64-unknown-linux-musl
18-
- os: macos-latest
20+
- build_name: linux-arm64-musl
21+
os: ubuntu-latest
22+
exe_suffix: ""
23+
name_suffix: ""
24+
target: aarch64-unknown-linux-musl
25+
- build_name: macos-arm64
26+
os: macos-latest
1927
exe_suffix: ""
2028
name_suffix: ".arm"
2129
target: aarch64-apple-darwin
22-
- os: windows-latest
30+
- build_name: windows-x64-msvc
31+
os: windows-latest
2332
exe_suffix: ".exe"
2433
name_suffix: ".exe"
2534
target: x86_64-pc-windows-msvc
2635
steps:
2736
- uses: actions/checkout@v3
28-
- name: Update rust
37+
- name: Update Rust
2938
run: rustup update
3039
- name: Add target
3140
run: rustup target add ${{ matrix.target }}
3241
- name: Cache dependencies
3342
uses: Swatinem/rust-cache@v2
3443
- name: Build
35-
run: "cargo build --release --locked --verbose --target ${{ matrix.target }}"
44+
shell: bash
45+
run: |
46+
_cargo="cargo"
47+
if [ "${{ matrix.build_name }}" = "linux-arm64-musl" ]; then
48+
cargo install cross
49+
_cargo="cross"
50+
fi
51+
$_cargo build --release --locked --verbose --target ${{ matrix.target }}
3652
- name: Upload asset
3753
uses: actions/upload-release-asset@v1.0.2
3854
env:
3955
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4056
with:
4157
asset_path: target/${{ matrix.target }}/release/dotter${{ matrix.exe_suffix }}
42-
asset_name: dotter${{ matrix.name_suffix }}
58+
asset_name: dotter-${{ matrix.build_name}}${{ matrix.name_suffix }}
4359
asset_content_type: application/octet-stream
4460
upload_url: ${{ github.event.release.upload_url }}
4561
build-completions:

0 commit comments

Comments
 (0)