Skip to content

Commit

Permalink
Build ARM binaries for Linux (#151)
Browse files Browse the repository at this point in the history
  • Loading branch information
orhun authored Dec 10, 2023
1 parent 1071fbc commit a6fd34f
Showing 1 changed file with 23 additions and 7 deletions.
30 changes: 23 additions & 7 deletions .github/workflows/build-for-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,53 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
build_name:
[linux-x64-musl, linux-arm64-musl, macos-arm64, windows-x64-msvc]
include:
- os: ubuntu-latest
- build_name: linux-x64-musl
os: ubuntu-latest
exe_suffix: ""
name_suffix: ""
target: x86_64-unknown-linux-musl
- os: macos-latest
- build_name: linux-arm64-musl
os: ubuntu-latest
exe_suffix: ""
name_suffix: ""
target: aarch64-unknown-linux-musl
- build_name: macos-arm64
os: macos-latest
exe_suffix: ""
name_suffix: ".arm"
target: aarch64-apple-darwin
- os: windows-latest
- build_name: windows-x64-msvc
os: windows-latest
exe_suffix: ".exe"
name_suffix: ".exe"
target: x86_64-pc-windows-msvc
steps:
- uses: actions/checkout@v3
- name: Update rust
- name: Update Rust
run: rustup update
- name: Add target
run: rustup target add ${{ matrix.target }}
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
- name: Build
run: "cargo build --release --locked --verbose --target ${{ matrix.target }}"
shell: bash
run: |
_cargo="cargo"
if [ "${{ matrix.build_name }}" = "linux-arm64-musl" ]; then
cargo install cross
_cargo="cross"
fi
$_cargo build --release --locked --verbose --target ${{ matrix.target }}
- name: Upload asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
asset_path: target/${{ matrix.target }}/release/dotter${{ matrix.exe_suffix }}
asset_name: dotter${{ matrix.name_suffix }}
asset_name: dotter-${{ matrix.build_name}}${{ matrix.name_suffix }}
asset_content_type: application/octet-stream
upload_url: ${{ github.event.release.upload_url }}
build-completions:
Expand Down

0 comments on commit a6fd34f

Please sign in to comment.