5a601bb0c0
- Added Windows ARM64 binary support and architecture detection in installers. - Updated WASM loading to use streaming with base64 fallback for binary compatibility. - Moved TTSR settings to dedicated tab and expanded abbreviation to Time Traveling Stream Rules. - Added comprehensive install testing infrastructure with Docker validation. - Updated package name from @oh-my-pi/omp-coding-agent to @oh-my-pi/pi-coding-agent.
103 lines
3.5 KiB
YAML
103 lines
3.5 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
tags: ["v*"]
|
|
pull_request:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
inputs:
|
|
skip_npm:
|
|
description: "Skip npm publish"
|
|
type: boolean
|
|
default: false
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
lfs: true
|
|
- uses: oven-sh/setup-bun@v2
|
|
- name: Cache bun dependencies
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/.bun/install/cache
|
|
key: bun-${{ runner.os }}-${{ hashFiles('**/bun.lock') }}
|
|
- name: Install system deps
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev fd-find ripgrep imagemagick
|
|
sudo ln -s $(which fdfind) /usr/local/bin/fd
|
|
sudo ln -sf /usr/bin/convert /usr/local/bin/magick
|
|
- run: bun install --frozen-lockfile
|
|
- run: bun run check
|
|
- run: bun test --only-failures
|
|
- name: CLI smoke test
|
|
run: |
|
|
bun packages/coding-agent/src/cli.ts --version
|
|
bun packages/coding-agent/src/cli.ts --help
|
|
|
|
release:
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
needs: test
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
id-token: write
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
lfs: true
|
|
- uses: oven-sh/setup-bun@v2
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "24"
|
|
registry-url: "https://registry.npmjs.org"
|
|
- name: Cache bun dependencies
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/.bun/install/cache
|
|
key: bun-${{ runner.os }}-${{ hashFiles('**/bun.lock') }}
|
|
- run: bun install --frozen-lockfile
|
|
- name: Generate WASM base64
|
|
run: bun packages/coding-agent/scripts/generate-wasm-b64.ts
|
|
- name: Build binaries
|
|
run: |
|
|
cd packages/coding-agent
|
|
mkdir -p binaries
|
|
bun build --compile --target=bun-darwin-arm64 ./src/cli.ts --outfile binaries/omp-darwin-arm64
|
|
bun build --compile --target=bun-darwin-x64 ./src/cli.ts --outfile binaries/omp-darwin-x64
|
|
bun build --compile --target=bun-linux-x64 ./src/cli.ts --outfile binaries/omp-linux-x64
|
|
bun build --compile --target=bun-linux-arm64 ./src/cli.ts --outfile binaries/omp-linux-arm64
|
|
bun build --compile --target=bun-windows-x64 ./src/cli.ts --outfile binaries/omp-windows-x64.exe
|
|
bun build --compile --target=bun-windows-arm64 ./src/cli.ts --outfile binaries/omp-windows-arm64.exe
|
|
- name: Create GitHub Release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
files: packages/coding-agent/binaries/*
|
|
generate_release_notes: true
|
|
- name: Publish to npm
|
|
if: ${{ !inputs.skip_npm }}
|
|
env:
|
|
NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
run: |
|
|
for pkg in packages/*/; do
|
|
pkg_name=$(basename "$pkg")
|
|
echo "Publishing $pkg_name..."
|
|
output=$(cd "$pkg" && bun publish --access public 2>&1) && echo "$output" && continue
|
|
echo "$output"
|
|
if echo "$output" | grep -q "previously published\|cannot publish over\|You cannot publish over"; then
|
|
echo "Already published, skipping"
|
|
else
|
|
echo "Failed to publish $pkg_name"
|
|
exit 1
|
|
fi
|
|
done
|