From 03cc0b7cbe2f58bab86d390a787bca0c76b6f6a7 Mon Sep 17 00:00:00 2001 From: Oliver Mee <102673257+Omee11@users.noreply.github.com> Date: Fri, 26 Jun 2026 13:42:31 +0800 Subject: [PATCH] feat: add linux-arm64 (aarch64) CLI build and install support Add a release-cli-linux-arm64 job that builds the hk CLI for aarch64-unknown-linux-musl on GitHub's free ubuntu-24.04-arm public runner, mirroring the existing x86_64 musl job, and uploads the artifact as hk-linux-arm64. Teach install.sh to map aarch64/arm64 on Linux to that binary instead of erroring with "unsupported architecture". This unblocks ARM64 Linux servers (e.g. Oracle Cloud Ampere A1), where install.sh previously failed on aarch64. Built and verified on a native aarch64 Ubuntu 24.04 box: the binary detects agents and runs the read-only commands (status, list, audit). --- .github/workflows/release.yml | 41 +++++++++++++++++++++++++++++++++++ install.sh | 5 +++-- 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b93c0b1c..6c506b52 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -198,6 +198,47 @@ jobs: cp target/x86_64-unknown-linux-musl/release/hk hk-linux-x64 gh release upload "${{ github.ref_name }}" hk-linux-x64 --clobber + release-cli-linux-arm64: + needs: create-release + runs-on: ubuntu-24.04-arm + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 22 + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + with: + targets: aarch64-unknown-linux-musl + + - name: Rust cache + uses: swatinem/rust-cache@v2 + with: + key: aarch64-unknown-linux-musl + + - name: Install musl toolchain + run: sudo apt-get update && sudo apt-get install -y musl-tools perl make + + - name: Install frontend dependencies + run: npm ci + + - name: Build CLI (with embedded web frontend) + run: | + npm run build + cargo build --release -p hk-cli --target aarch64-unknown-linux-musl + + - name: Upload CLI to release + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + cp target/aarch64-unknown-linux-musl/release/hk hk-linux-arm64 + gh release upload "${{ github.ref_name }}" hk-linux-arm64 --clobber + release-cli-windows: needs: create-release runs-on: windows-latest diff --git a/install.sh b/install.sh index 929f148e..26160d2d 100755 --- a/install.sh +++ b/install.sh @@ -24,8 +24,9 @@ case "$OS" in ;; Linux) case "$ARCH" in - x86_64) BINARY="hk-linux-x64" ;; - *) echo "Error: unsupported architecture: $ARCH"; exit 1 ;; + x86_64) BINARY="hk-linux-x64" ;; + aarch64|arm64) BINARY="hk-linux-arm64" ;; + *) echo "Error: unsupported architecture: $ARCH"; exit 1 ;; esac ;; *)