Skip to content

Commit

Permalink
Build for linux arm64 (#382)
Browse files Browse the repository at this point in the history
  • Loading branch information
chdsbd authored Sep 24, 2024
1 parent 0ced957 commit a4019ca
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,49 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build-linux-arm64:
needs: pre_job
if: needs.pre_job.outputs.should_skip != 'true' || startsWith(github.ref, 'refs/tags/')

name: Linux arm64
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Apt
run: sudo apt-get install gcc-aarch64-linux-gnu

- name: Install Toolchain
uses: oxidecomputer/actions-rs_toolchain@ad3f86084a8a5acf2c09cb691421b31cf8af7a36 # pin@oxide/master
with:
toolchain: stable
target: aarch64-unknown-linux-gnu
profile: minimal
override: true

- name: Cache
uses: Swatinem/rust-cache@6fd3edff6979b79f87531400ad694fb7f2c84b1f # pin@v2

- name: Build
run: RUSTFLAGS="-C linker=aarch64-linux-gnu-gcc" cargo build --target aarch64-unknown-linux-gnu --release && mv target/aarch64-unknown-linux-gnu/release/squawk target/release/squawk-linux-arm64

- name: Artifact
uses: actions/upload-artifact@v3
with:
name: release
path: target/release/squawk-linux-arm64

- name: Release
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # pin@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
target/release/squawk-linux-arm64
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build-windows:
needs: pre_job
if: needs.pre_job.outputs.should_skip != 'true' || startsWith(github.ref, 'refs/tags/')
Expand Down
1 change: 1 addition & 0 deletions js/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ const SUPPORTED_PLATFORMS = new Set([
"darwin-x64",
"darwin-arm64",
"linux-x64",
"linux-arm64",
"win32-x64",
])
const BINARY_NAME_OVERRIDE = new Map([["win32-x64", "squawk-windows-x64.exe"]])
Expand Down

0 comments on commit a4019ca

Please sign in to comment.