-
Notifications
You must be signed in to change notification settings - Fork 237
78 lines (68 loc) · 2.33 KB
/
build-binaries.yml
File metadata and controls
78 lines (68 loc) · 2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Build Platform Binaries
on:
workflow_dispatch:
push:
tags:
- 'v*'
jobs:
build-platform:
name: Build ${{ matrix.slug }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
slug: codemachine-linux-x64
- os: macos-14
slug: codemachine-darwin-arm64
- os: macos-13
slug: codemachine-darwin-x64
- os: windows-latest
slug: codemachine-windows-x64
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: 1.3.0
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Build platform binary
run: bun run build
- name: Verify cm alias in package.json
shell: bash
run: |
if ! grep -q '"cm"' binaries/${{ matrix.slug }}/package.json; then
echo "❌ ERROR: 'cm' alias missing from binaries/${{ matrix.slug }}/package.json"
exit 1
fi
echo "✅ cm alias verified in package.json"
- name: Test binary execution (Unix)
if: runner.os != 'Windows'
continue-on-error: true
run: |
chmod +x binaries/${{ matrix.slug }}/codemachine
binaries/${{ matrix.slug }}/codemachine --version || echo "⚠️ Binary execution test skipped (may require dependencies)"
- name: Test binary execution (Windows)
if: runner.os == 'Windows'
continue-on-error: true
run: |
binaries/${{ matrix.slug }}/codemachine.exe --version
if ($LASTEXITCODE -ne 0) { Write-Host "⚠️ Binary execution test skipped (may require dependencies)" }
- name: Upload binary package
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.slug }}
path: binaries/${{ matrix.slug }}
- name: Publish platform package to npm
if: startsWith(github.ref, 'refs/tags/v')
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
CI: true
shell: bash
run: |
echo "//registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN" > ~/.npmrc
chmod 600 ~/.npmrc
bun scripts/publish-platform.mjs --tag latest --access public