From 6d37142ab00085d2d66899fce041f1d16e9d9620 Mon Sep 17 00:00:00 2001 From: "Jiaxiao (mossaka) Zhou" Date: Fri, 27 Feb 2026 01:21:49 +0000 Subject: [PATCH] Add android-arm64 architecture support Closes #18263 Add android-arm64 binary to release builds so the extension can be installed on Android ARM64 devices (e.g., via Termux). Changes: - Add android-arm64 to build-release.sh platforms array - Add Android OS detection (via ANDROID_ROOT env var) in install script - Add build-android Makefile target Co-Authored-By: Claude Opus 4.6 --- Makefile | 6 +++++- actions/setup-cli/install.sh | 8 ++++++-- install-gh-aw.sh | 8 ++++++-- scripts/build-release.sh | 1 + 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 69c1aa24fab..2fd3669d7e7 100644 --- a/Makefile +++ b/Makefile @@ -24,7 +24,7 @@ build: sync-action-pins sync-action-scripts # Build for all platforms .PHONY: build-all -build-all: build-linux build-darwin build-windows +build-all: build-linux build-darwin build-windows build-android .PHONY: build-linux build-linux: @@ -40,6 +40,10 @@ build-darwin: build-windows: GOOS=windows GOARCH=amd64 go build $(LDFLAGS) -o $(BINARY_NAME)-windows-amd64.exe ./cmd/gh-aw +.PHONY: build-android +build-android: + CGO_ENABLED=0 GOOS=android GOARCH=arm64 go build $(LDFLAGS) -o $(BINARY_NAME)-android-arm64 ./cmd/gh-aw + # Build WebAssembly module for browser usage # Optionally runs wasm-opt (from Binaryen) if available for ~8% size reduction .PHONY: build-wasm diff --git a/actions/setup-cli/install.sh b/actions/setup-cli/install.sh index 75f42499798..e1ac3479a12 100755 --- a/actions/setup-cli/install.sh +++ b/actions/setup-cli/install.sh @@ -111,7 +111,11 @@ ARCH=$(uname -m) # Normalize OS name case $OS in Linux) - OS_NAME="linux" + if [ -n "$ANDROID_ROOT" ]; then + OS_NAME="android" + else + OS_NAME="linux" + fi ;; Darwin) OS_NAME="darwin" @@ -124,7 +128,7 @@ case $OS in ;; *) print_error "Unsupported operating system: $OS" - print_info "Supported operating systems: Linux, macOS (Darwin), FreeBSD, Windows" + print_info "Supported operating systems: Linux, macOS (Darwin), FreeBSD, Windows, Android (Termux)" exit 1 ;; esac diff --git a/install-gh-aw.sh b/install-gh-aw.sh index 75f42499798..e1ac3479a12 100755 --- a/install-gh-aw.sh +++ b/install-gh-aw.sh @@ -111,7 +111,11 @@ ARCH=$(uname -m) # Normalize OS name case $OS in Linux) - OS_NAME="linux" + if [ -n "$ANDROID_ROOT" ]; then + OS_NAME="android" + else + OS_NAME="linux" + fi ;; Darwin) OS_NAME="darwin" @@ -124,7 +128,7 @@ case $OS in ;; *) print_error "Unsupported operating system: $OS" - print_info "Supported operating systems: Linux, macOS (Darwin), FreeBSD, Windows" + print_info "Supported operating systems: Linux, macOS (Darwin), FreeBSD, Windows, Android (Termux)" exit 1 ;; esac diff --git a/scripts/build-release.sh b/scripts/build-release.sh index f7a7a4997e0..dbfeb051670 100755 --- a/scripts/build-release.sh +++ b/scripts/build-release.sh @@ -20,6 +20,7 @@ platforms=( linux-amd64 linux-arm linux-arm64 + android-arm64 windows-amd64 windows-arm64 )