Skip to content

Commit a2f424b

Browse files
Mossakaclaude
andauthored
feat: add ARM64 binary support for awf CLI (#965)
* feat: add ARM64 binary support for awf CLI Publish both x64 and arm64 binaries in releases so agentic workflows can run natively on ARM64 self-hosted runners without QEMU emulation. - Add node18-linux-arm64 target to pkg config - Build and upload both binaries in release workflow - Add arm64 ELF validation step in CI - Update install.sh to auto-detect architecture (x86_64/aarch64) - Update release template docs for ARM64 Closes github/gh-aw#16005 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: resolve high-severity minimatch vulnerability via npm override Add npm overrides for minimatch>=10.2.1 to fix GHSA-3ppc-4f35-3m26 (ReDoS via repeated wildcards). This resolves 24 high-severity findings from transitive deps in jest, eslint, and typescript-eslint. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 7c8da85 commit a2f424b

5 files changed

Lines changed: 106 additions & 192 deletions

File tree

.github/workflows/release.yml

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -300,24 +300,36 @@ jobs:
300300
run: |
301301
mkdir -p release
302302
303-
# Create standalone executable for Linux
303+
# Create standalone executables for Linux (x64 and arm64)
304304
pkg . \
305305
--targets node18-linux-x64 \
306306
--output release/awf-linux-x64
307307
308-
# Verify the binary was created
308+
pkg . \
309+
--targets node18-linux-arm64 \
310+
--output release/awf-linux-arm64
311+
312+
# Verify the binaries were created
309313
echo "=== Contents of release directory ==="
310314
ls -lh release/
311-
echo "=== Verifying binary ==="
312-
test -f release/awf-linux-x64 && echo "✓ Binary exists at release/awf-linux-x64" || echo "✗ Binary NOT found!"
313-
file release/awf-linux-x64
315+
echo "=== Verifying binaries ==="
316+
for bin in awf-linux-x64 awf-linux-arm64; do
317+
test -f "release/$bin" && echo "✓ Binary exists at release/$bin" || echo "✗ Binary NOT found: $bin"
318+
file "release/$bin"
319+
done
314320
315-
- name: Smoke test binary
321+
- name: Smoke test binary (x64)
316322
run: |
317323
npx tsx scripts/ci/smoke-test-binary.ts \
318324
release/awf-linux-x64 \
319325
${{ needs.setup.outputs.version_number }}
320326
327+
- name: Verify arm64 binary is valid ELF
328+
run: |
329+
file release/awf-linux-arm64 | grep -q "ELF 64-bit LSB" || { echo "ERROR: arm64 binary is not a valid ELF"; exit 1; }
330+
file release/awf-linux-arm64 | grep -qi "aarch64\|arm" || { echo "ERROR: arm64 binary is not for ARM architecture"; exit 1; }
331+
echo "✓ arm64 binary is a valid ELF for ARM64"
332+
321333
- name: Create tarball for npm package
322334
run: |
323335
npm pack
@@ -442,6 +454,7 @@ jobs:
442454
prerelease: ${{ contains(needs.setup.outputs.version, 'alpha') || contains(needs.setup.outputs.version, 'beta') || contains(needs.setup.outputs.version, 'rc') }}
443455
files: |
444456
release/awf-linux-x64
457+
release/awf-linux-arm64
445458
release/awf.tgz
446459
release/checksums.txt
447460
env:

docs/RELEASE_TEMPLATE.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,14 @@ Everything below the `---` separator becomes the release notes.
3131

3232
### One-Line Installer (Recommended)
3333

34-
**Linux (x64) with automatic SHA verification:**
34+
**Linux (x64 and ARM64) with automatic SHA verification:**
3535
```bash
3636
curl -sSL https://raw.githubusercontent.com/{{REPOSITORY}}/main/install.sh | sudo bash
3737
```
3838

3939
This installer:
40-
- Downloads the latest release binary
40+
- Automatically detects your architecture (x86_64 or aarch64)
41+
- Downloads the correct release binary
4142
- Verifies SHA256 checksum against `checksums.txt`
4243
- Validates the file is a valid ELF executable
4344
- Installs to `/usr/local/bin/awf`
@@ -58,6 +59,20 @@ chmod +x awf
5859
sudo mv awf /usr/local/bin/
5960
```
6061

62+
**Linux (ARM64):**
63+
```bash
64+
# Download binary and checksums
65+
curl -fL https://github.com/{{REPOSITORY}}/releases/download/{{VERSION}}/awf-linux-arm64 -o awf
66+
curl -fL https://github.com/{{REPOSITORY}}/releases/download/{{VERSION}}/checksums.txt -o checksums.txt
67+
68+
# Verify checksum
69+
sha256sum -c checksums.txt --ignore-missing
70+
71+
# Install
72+
chmod +x awf
73+
sudo mv awf /usr/local/bin/
74+
```
75+
6176
### NPM Installation (Alternative)
6277

6378
```bash

install.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ set -e
3232
# Issue #107: https://github.com/github/gh-aw-firewall/issues/107
3333

3434
REPO="github/gh-aw-firewall"
35-
BINARY_NAME="awf-linux-x64"
35+
BINARY_NAME="" # Set dynamically by check_platform
3636
INSTALL_DIR="/usr/local/bin"
3737
INSTALL_NAME="awf"
3838

@@ -93,12 +93,18 @@ check_platform() {
9393

9494
case "$arch" in
9595
x86_64|amd64)
96+
BINARY_NAME="awf-linux-x64"
97+
;;
98+
aarch64|arm64)
99+
BINARY_NAME="awf-linux-arm64"
96100
;;
97101
*)
98-
error "Unsupported architecture: $arch (supported: x86_64)"
102+
error "Unsupported architecture: $arch (supported: x86_64, aarch64)"
99103
exit 1
100104
;;
101105
esac
106+
107+
info "Detected architecture: $arch (binary: $BINARY_NAME)"
102108
}
103109

104110
# Validate version format (should be like v1.0.0, v1.2.3, etc.)

0 commit comments

Comments
 (0)