Skip to content

Commit

Permalink
Build a Linux binary for ARM processors + update binary names (#102)
Browse files Browse the repository at this point in the history
* Build a Linux binary for ARM processors in GitHub Actions

* Use aarch64 suffix, not arm64, for Apple Silicon binaries
  • Loading branch information
timrogers authored Oct 11, 2024
1 parent 4beaaf1 commit 69e6e72
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions .github/workflows/build_and_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,19 @@ jobs:
binary_name: linux-amd64,
os: ubuntu-latest,
}
- {
target: aarch64-unknown-linux-gnu,
binary_name: linux-aarch64,
os: self-hosted,
}
- {
target: x86_64-apple-darwin,
binary_name: darwin-amd64,
os: macos-latest,
}
- {
target: aarch64-apple-darwin,
binary_name: darwin-arm64,
binary_name: darwin-aarch64,
os: macos-latest,
}
- {
Expand All @@ -34,7 +39,7 @@ jobs:
- uses: actions/checkout@v4
- name: Install libudev-dev
run: sudo apt-get update && sudo apt-get install libudev-dev
if: matrix.job.os == 'ubuntu-latest'
if: matrix.job.os == 'ubuntu-latest' || matrix.job.os == 'self-hosted'
- name: Cache Rust dependencies
uses: actions/[email protected]
with:
Expand Down Expand Up @@ -117,9 +122,9 @@ jobs:
- name: Download macOS arm64 binary
uses: actions/download-artifact@v4
with:
name: litra_${{ steps.sanitise_ref.outputs.value }}_darwin-arm64
name: litra_${{ steps.sanitise_ref.outputs.value }}_darwin-aarch64
- name: Create universal macOS binary
run: lipo -create -output litra_${{ steps.sanitise_ref.outputs.value }}_darwin-universal litra_${{ steps.sanitise_ref.outputs.value }}_darwin-amd64 litra_${{ steps.sanitise_ref.outputs.value }}_darwin-arm64
run: lipo -create -output litra_${{ steps.sanitise_ref.outputs.value }}_darwin-universal litra_${{ steps.sanitise_ref.outputs.value }}_darwin-amd64 litra_${{ steps.sanitise_ref.outputs.value }}_darwin-aarch64
- name: Write Apple signing key to a file (macOS only)
env:
APPLE_SIGNING_KEY_P12: ${{ secrets.APPLE_SIGNING_KEY_P12 }}
Expand Down Expand Up @@ -193,12 +198,15 @@ jobs:
- uses: actions/download-artifact@v4
with:
name: litra_${{ steps.sanitise_ref.outputs.value }}_linux-amd64
- uses: actions/download-artifact@v4
with:
name: litra_${{ steps.sanitise_ref.outputs.value }}_linux-aarch64
- uses: actions/download-artifact@v4
with:
name: litra_${{ steps.sanitise_ref.outputs.value }}_darwin-amd64
- uses: actions/download-artifact@v4
with:
name: litra_${{ steps.sanitise_ref.outputs.value }}_darwin-arm64
name: litra_${{ steps.sanitise_ref.outputs.value }}_darwin-aarch64
- uses: actions/download-artifact@v4
with:
name: litra_${{ steps.sanitise_ref.outputs.value }}_darwin-universal
Expand All @@ -211,8 +219,9 @@ jobs:
files: |
litra_${{ steps.sanitise_ref.outputs.value }}_windows-amd64.exe
litra_${{ steps.sanitise_ref.outputs.value }}_darwin-amd64
litra_${{ steps.sanitise_ref.outputs.value }}_darwin-arm64
litra_${{ steps.sanitise_ref.outputs.value }}_darwin-aarch64
litra_${{ steps.sanitise_ref.outputs.value }}_linux-amd64
litra_${{ steps.sanitise_ref.outputs.value }}_linux-aarch64
litra_${{ steps.sanitise_ref.outputs.value }}_darwin-universal
cargo_publish:
name: Publish with Cargo to Crates.io
Expand Down

0 comments on commit 69e6e72

Please sign in to comment.