Skip to content
Closed
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
b2d7dca
Add bun-compile GitHub Action workflow
kjiang-ac Mar 5, 2026
5a63113
temp: add push trigger for testing
kjiang-ac Mar 5, 2026
6659b2a
fix: install npm package before bun compile
kjiang-ac Mar 5, 2026
7d198cc
fix: patch process.argv[1] for bun compile compatibility
kjiang-ac Mar 5, 2026
0753f6a
revert: remove process.argv[1] patch from entry point
kjiang-ac Mar 5, 2026
6419df6
feat: add repository_dispatch trigger for automated npm sync
kjiang-ac Mar 5, 2026
8e56c07
rename binary assets from auggie-bun-* to auggie-*
kjiang-ac Mar 5, 2026
7e74922
fix: use clean artifact names without .exe suffix
kjiang-ac Mar 7, 2026
741590c
fix: clean artifact names, re-add push trigger for testing
kjiang-ac Mar 7, 2026
114d5ef
fix: update version fallback to 0.18.1
kjiang-ac Mar 7, 2026
e588669
fix: remove hardcoded version fallback, fail fast if no version provided
kjiang-ac Mar 9, 2026
e4c8182
Add macOS signing and checksums to bun-compile workflow
kjiang-ac Mar 10, 2026
84d7420
test: add temporary test config for signing workflow
kjiang-ac Mar 10, 2026
a59c124
test: add version fallback for push trigger
kjiang-ac Mar 10, 2026
862e0cf
fix: auto-detect codesign identity from keychain
kjiang-ac Mar 10, 2026
1004b51
test: add version fallback to release job
kjiang-ac Mar 10, 2026
90f003d
revert: remove temporary test config
kjiang-ac Mar 10, 2026
3089774
test: temporary test config for v0.19.0-prerelease.1
kjiang-ac Mar 10, 2026
b915a97
test: update to v0.19.0-prerelease.3
kjiang-ac Mar 10, 2026
834340a
test: update to v0.19.0-prerelease.5
kjiang-ac Mar 10, 2026
bc8720f
revert: remove temporary test config
kjiang-ac Mar 10, 2026
4bc14df
fix: add identity guard and use sha256sum
kjiang-ac Mar 10, 2026
af03529
fix: add timestamp, clean up cert and zip after use
kjiang-ac Mar 10, 2026
1a803d6
Add retry with backoff for npm install in Bun Compile workflow
kjiang-ac Mar 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
154 changes: 154 additions & 0 deletions .github/workflows/bun-compile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
# Bun Compile
# Compiles Auggie CLI into self-contained native binaries using Bun,
# pulling the pre-built @augmentcode/auggie package from npm.

name: Bun Compile
on:
workflow_dispatch:
inputs:
version:
description: 'npm package version (e.g. 0.17.0)'
required: true
type: string
repository_dispatch:
types: [npm-published]
push:
branches:
- auggie-bun-compile-workflow

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- target: bun-darwin-arm64
os: macos-latest
output: auggie-darwin-arm64
artifact: auggie-darwin-arm64
- target: bun-darwin-x64
os: macos-latest
output: auggie-darwin-x64
artifact: auggie-darwin-x64
- target: bun-linux-x64
os: ubuntu-latest
output: auggie-linux-x64
artifact: auggie-linux-x64
- target: bun-windows-x64
os: ubuntu-latest
output: auggie-windows-x64.exe
artifact: auggie-windows-x64
permissions:
contents: read
steps:
- name: Set up Bun
uses: oven-sh/setup-bun@v2

- name: Install package
env:
VERSION: ${{ inputs.version || github.event.client_payload.version }}
run: |
if [ -z "$VERSION" ]; then
echo "::error::No version provided. Supply via workflow_dispatch input or repository_dispatch payload."
exit 1
fi
# Retry with backoff — npm registry may not have propagated the version yet
# when triggered immediately via repository_dispatch on publish.
max_attempts=5
for attempt in $(seq 1 $max_attempts); do
echo "Attempt $attempt/$max_attempts: installing @augmentcode/auggie@${VERSION}"
if bun install "@augmentcode/auggie@${VERSION}"; then
echo "Successfully installed on attempt $attempt"
exit 0
fi
if [ "$attempt" -lt "$max_attempts" ]; then
delay=$((attempt * 30))
echo "Install failed, retrying in ${delay}s..."
sleep "$delay"
fi
done
echo "::error::Failed to install @augmentcode/auggie@${VERSION} after $max_attempts attempts"
exit 1

- name: Create entry point
run: |
echo 'await import("@augmentcode/auggie");' > augment.mjs

- name: Compile binary
run: bun build augment.mjs --compile --target=${{ matrix.target }} --outfile=${{ matrix.output }}

- name: Import code signing certificate
if: contains(matrix.target, 'darwin')
env:
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
run: |
echo "$APPLE_CERTIFICATE" | base64 --decode > certificate.p12
security create-keychain -p "temppass" build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p "temppass" build.keychain
security import certificate.p12 -k build.keychain -P "$APPLE_CERTIFICATE_PASSWORD" -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "temppass" build.keychain
rm -f certificate.p12

- name: Sign binary
if: contains(matrix.target, 'darwin')
run: |
IDENTITY=$(security find-identity -v -p codesigning build.keychain | grep "Developer ID" | head -1 | sed 's/.*"\(.*\)".*/\1/')
if [ -z "$IDENTITY" ]; then
echo "::error::No Developer ID signing identity found in build.keychain"
exit 1
fi
echo "Signing with identity: $IDENTITY"
codesign --force --options runtime --timestamp --sign "$IDENTITY" ${{ matrix.output }}

- name: Notarize binary
if: contains(matrix.target, 'darwin')
env:
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
run: |
zip "${{ matrix.output }}.zip" "${{ matrix.output }}"
xcrun notarytool submit "${{ matrix.output }}.zip" --apple-id "$APPLE_ID" --password "$APPLE_APP_SPECIFIC_PASSWORD" --team-id "$APPLE_TEAM_ID" --wait
rm -f "${{ matrix.output }}.zip"

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact }}
path: ${{ matrix.output }}

release:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true

- name: Generate checksums
run: |
cd artifacts
sha256sum auggie-* > checksums.txt
cat checksums.txt

- name: Create GitHub Release
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
VERSION: ${{ inputs.version || github.event.client_payload.version }}
run: |
if [ -z "$VERSION" ]; then
echo "::error::No version provided. Cannot create release."
exit 1
fi
gh release create "v${VERSION}" \
--title "v${VERSION}" \
--generate-notes \
artifacts/*