Skip to content

Commit

Permalink
build essential package for aarch64
Browse files Browse the repository at this point in the history
  • Loading branch information
spencerwooo committed Nov 27, 2023
1 parent c8cde99 commit 7e437dd
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ jobs:
target:
- x86_64-unknown-linux-gnu
- x86_64-unknown-linux-musl
# - aarch64-unknown-linux-gnu
# - aarch64-unknown-linux-musl
- aarch64-unknown-linux-gnu
- aarch64-unknown-linux-musl
- x86_64-pc-windows-msvc
- i686-pc-windows-msvc
- x86_64-apple-darwin
Expand All @@ -35,31 +35,23 @@ jobs:
- target: x86_64-unknown-linux-gnu
os: ubuntu-22.04
target-apt-arch: amd64
cross: false
- target: x86_64-unknown-linux-musl
os: ubuntu-22.04
target-apt-arch: amd64
cross: false
# - target: aarch64-unknown-linux-gnu
# os: ubuntu-22.04
# target-apt-arch: arm64
# cross: true
# - target: aarch64-unknown-linux-musl
# os: ubuntu-22.04
# target-apt-arch: arm64
# cross: true
- target: aarch64-unknown-linux-gnu
os: ubuntu-22.04
target-apt-arch: arm64
- target: aarch64-unknown-linux-musl
os: ubuntu-22.04
target-apt-arch: arm64
- target: x86_64-pc-windows-msvc
os: windows-latest
cross: false
- target: i686-pc-windows-msvc
os: windows-latest
cross: false
- target: x86_64-apple-darwin
os: macos-latest
cross: false
- target: aarch64-apple-darwin
os: macos-latest
cross: false

env:
BIN_NAME: bitsrun
Expand Down Expand Up @@ -93,16 +85,21 @@ jobs:
sudo apt-get -yq update
# libc6 must be present to run executables dynamically linked
# against glibc for the target architecture
sudo apt-get -yq install qemu-user gcc-aarch64-linux-gnu libc6:arm64
sudo apt-get -yq install qemu-user crossbuild-essential-arm64 libc6:arm64
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
target: ${{ env.CARGO_BUILD_TARGET }}

- name: Build binaries
if: ${{ !startsWith(env.CARGO_BUILD_TARGET, 'aarch64-unknown-linux') }}
run: cargo build --release --target=${{ env.CARGO_BUILD_TARGET }}

- name: Build binaries (Cross compile aarch64)
if: ${{ startsWith(env.CARGO_BUILD_TARGET, 'aarch64-unknown-linux') }}
run: cargo build --release --target=${{ env.CARGO_BUILD_TARGET }} -C linker=${{ env.CARGO_BUILD_TARGET }}

- name: Strip binaries for Linux and macOS
if: endsWith(env.CARGO_BUILD_TARGET, '-windows-msvc') == false
run: strip target/${{ env.CARGO_BUILD_TARGET }}/release/${{ env.BIN_NAME }}
Expand Down

0 comments on commit 7e437dd

Please sign in to comment.