Skip to content

Commit d41d376

Browse files
authored
Add bun-compile GitHub Action workflow (#96)
Adds a workflow that compiles the Auggie CLI into self-contained native binaries (darwin-arm64, darwin-x64, linux-x64, windows-x64) using `bun build --compile`. Triggered via workflow_dispatch with a version input or repository_dispatch from npm publish. Builds run in parallel via matrix strategy and artifacts are uploaded as a GitHub Release.
1 parent d6f80cb commit d41d376

File tree

1 file changed

+92
-0
lines changed

1 file changed

+92
-0
lines changed

.github/workflows/bun-compile.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Bun Compile
2+
# Compiles Auggie CLI into self-contained native binaries using Bun,
3+
# pulling the pre-built @augmentcode/auggie package from npm.
4+
5+
name: Bun Compile
6+
on:
7+
workflow_dispatch:
8+
inputs:
9+
version:
10+
description: 'npm package version (e.g. 0.17.0)'
11+
required: true
12+
type: string
13+
repository_dispatch:
14+
types: [npm-published]
15+
push:
16+
branches:
17+
- auggie-bun-compile-workflow
18+
19+
jobs:
20+
build:
21+
runs-on: ubuntu-latest
22+
strategy:
23+
matrix:
24+
include:
25+
- target: bun-darwin-arm64
26+
output: auggie-darwin-arm64
27+
artifact: auggie-darwin-arm64
28+
- target: bun-darwin-x64
29+
output: auggie-darwin-x64
30+
artifact: auggie-darwin-x64
31+
- target: bun-linux-x64
32+
output: auggie-linux-x64
33+
artifact: auggie-linux-x64
34+
- target: bun-windows-x64
35+
output: auggie-windows-x64.exe
36+
artifact: auggie-windows-x64
37+
permissions:
38+
contents: read
39+
steps:
40+
- name: Set up Bun
41+
uses: oven-sh/setup-bun@v2
42+
43+
- name: Install package
44+
env:
45+
VERSION: ${{ inputs.version || github.event.client_payload.version }}
46+
run: |
47+
if [ -z "$VERSION" ]; then
48+
echo "::error::No version provided. Supply via workflow_dispatch input or repository_dispatch payload."
49+
exit 1
50+
fi
51+
bun install "@augmentcode/auggie@${VERSION}"
52+
53+
- name: Create entry point
54+
run: |
55+
echo 'await import("@augmentcode/auggie");' > augment.mjs
56+
57+
- name: Compile binary
58+
run: bun build augment.mjs --compile --target=${{ matrix.target }} --outfile=${{ matrix.output }}
59+
60+
- name: Upload artifact
61+
uses: actions/upload-artifact@v4
62+
with:
63+
name: ${{ matrix.artifact }}
64+
path: ${{ matrix.output }}
65+
66+
release:
67+
needs: build
68+
runs-on: ubuntu-latest
69+
permissions:
70+
contents: write
71+
steps:
72+
- name: Download all artifacts
73+
uses: actions/download-artifact@v4
74+
with:
75+
path: artifacts
76+
merge-multiple: true
77+
78+
- name: Create GitHub Release
79+
env:
80+
GH_TOKEN: ${{ github.token }}
81+
GH_REPO: ${{ github.repository }}
82+
VERSION: ${{ inputs.version || github.event.client_payload.version }}
83+
run: |
84+
if [ -z "$VERSION" ]; then
85+
echo "::error::No version provided. Cannot create release."
86+
exit 1
87+
fi
88+
gh release create "v${VERSION}" \
89+
--title "v${VERSION}" \
90+
--generate-notes \
91+
artifacts/*
92+

0 commit comments

Comments
 (0)