ci: migrate binaries to GitHub Release + Actions CI

- Add .github/workflows/build-binaries.yml (Go cross-compile → preset release)
- installer.ts: download from GitHub Release, fallback to local bin/
- package.json: exclude binaries from npm (16.3MB → 161KB)
- .gitignore: stop tracking bin/codeagent-wrapper-*
- git rm --cached 6 pre-compiled binaries
This commit is contained in:
li committed 2026-03-10 22:26:14 +08:00
1 parent 5769a1dbe6
commit 968cbedb8a
4 files changed
+130 -12

No files matched your search

+74
View File
@@ -0,0 +1,74 @@
name: Build codeagent-wrapper binaries
on:
push:
paths:
- 'codeagent-wrapper/**'
workflow_dispatch:
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Cross-compile binaries
working-directory: codeagent-wrapper
run: |
set -e
mkdir -p ../artifacts
declare -a targets=(
"darwin:amd64:"
"darwin:arm64:"
"linux:amd64:"
"linux:arm64:"
"windows:amd64:.exe"
"windows:arm64:.exe"
)
for target in "${targets[@]}"; do
IFS=':' read -r os arch ext <<< "$target"
output="codeagent-wrapper-${os}-${arch}${ext}"
echo "::group::Building ${output}"
GOOS=$os GOARCH=$arch go build -ldflags="-s -w" -o "../artifacts/${output}" .
echo "::endgroup::"
done
echo "### Build artifacts" >> $GITHUB_STEP_SUMMARY
ls -lh ../artifacts/ | awk 'NR>1{printf "- `%s` (%s)\n", $NF, $5}' >> $GITHUB_STEP_SUMMARY
- name: Delete existing preset release
run: gh release delete preset --yes --cleanup-tag 2>/dev/null || true
env:
GH_TOKEN: ${{ github.token }}
- name: Create preset release
uses: softprops/action-gh-release@v2
with:
tag_name: preset
name: "Pre-built Binaries (codeagent-wrapper)"
body: |
Pre-compiled `codeagent-wrapper` binaries for all supported platforms.
Automatically downloaded during `npx ccg-workflow` installation.
| File | Platform | Architecture |
|------|----------|-------------|
| `codeagent-wrapper-darwin-amd64` | macOS | Intel x64 |
| `codeagent-wrapper-darwin-arm64` | macOS | Apple Silicon |
| `codeagent-wrapper-linux-amd64` | Linux | x64 |
| `codeagent-wrapper-linux-arm64` | Linux | ARM64 |
| `codeagent-wrapper-windows-amd64.exe` | Windows | x64 |
| `codeagent-wrapper-windows-arm64.exe` | Windows | ARM64 |
> This release is automatically updated when `codeagent-wrapper/` source changes.
files: artifacts/*
prerelease: true
make_latest: false