Skip to content

Commit c619dec

Browse files
sanchitrkclaude
andcommitted
ci(tui): build and publish prebuilt TUI binaries on canary
`@codeworksh/cli` depends on `@codeworksh/tui`, which nothing published, so canary could not release the CLI. - `.github/workflows/tui.yml` (reusable) builds the TUI for macOS arm64/x64 and Linux arm64/x64, Linux as static musl binaries, and uploads one artifact per platform package. - Four platform packages, `@codeworksh/tui-<os>-<arch>`, live under packages/tui/npm as workspace packages with `os`/`cpu` set; their build stages the downloaded binary. `@codeworksh/tui` depends on them as optional workspace dependencies, so publish pins them like any other workspace dependency. - canary.yml runs the build first, then publishes in order aikit, plugin, harness, the platform packages, tui, cli. - dev.yml runs `cargo check` on the TUI. - `publish.mjs` knows the tui targets and carries `os`/`cpu`; `pnpm bump:tui` moves all five versions together. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 4bc731e commit c619dec

20 files changed

Lines changed: 296 additions & 18 deletions

File tree

‎.github/workflows/canary.yml‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ concurrency:
1515
cancel-in-progress: false
1616

1717
jobs:
18+
tui:
19+
uses: ./.github/workflows/tui.yml
20+
1821
publish:
22+
needs: tui
1923
runs-on: ubuntu-latest
2024
steps:
2125
- uses: actions/checkout@v6
@@ -30,5 +34,10 @@ jobs:
3034
- run: vp run @codeworksh/aikit#build
3135
- run: vp check packages scripts .github
3236
- run: vp run --filter './packages/*' --concurrency-limit 2 typecheck
37+
# One directory per platform package; each package's build stages its binary from here.
38+
- uses: actions/download-artifact@v4
39+
with:
40+
pattern: tui-*
41+
path: packages/tui/dist/bin
3342
- name: Publish all packages under canary
3443
run: node scripts/canary.mjs

‎.github/workflows/dev.yml‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,16 @@ jobs:
3333
- run: vp check packages scripts .github
3434
- run: vp run --filter './packages/*' --concurrency-limit 2 typecheck
3535
- run: vp run --filter './packages/*' --concurrency-limit 2 build
36+
37+
tui:
38+
runs-on: ubuntu-latest
39+
defaults:
40+
run:
41+
working-directory: packages/tui
42+
steps:
43+
- uses: actions/checkout@v6
44+
- uses: dtolnay/rust-toolchain@stable
45+
- uses: Swatinem/rust-cache@v2
46+
with:
47+
workspaces: packages/tui
48+
- run: cargo check --locked

‎.github/workflows/tui.yml‎

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: TUI Binaries
2+
3+
# Builds the Rust TUI for every published platform and uploads one artifact per
4+
# platform package, named after it (`tui-<os>-<arch>`). Publishing workflows call
5+
# this and stage the artifacts under packages/tui/dist/bin before `publish.mjs`.
6+
on:
7+
workflow_call:
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
build:
15+
name: build (${{ matrix.package }})
16+
runs-on: ${{ matrix.runner }}
17+
strategy:
18+
fail-fast: true
19+
matrix:
20+
include:
21+
- package: tui-darwin-arm64
22+
runner: macos-14
23+
target: aarch64-apple-darwin
24+
- package: tui-darwin-x64
25+
runner: macos-14
26+
target: x86_64-apple-darwin
27+
# Linux binaries link musl statically, so one build runs on any distro.
28+
- package: tui-linux-arm64
29+
runner: ubuntu-24.04-arm
30+
target: aarch64-unknown-linux-musl
31+
- package: tui-linux-x64
32+
runner: ubuntu-24.04
33+
target: x86_64-unknown-linux-musl
34+
defaults:
35+
run:
36+
working-directory: packages/tui
37+
steps:
38+
- uses: actions/checkout@v6
39+
- if: runner.os == 'Linux'
40+
run: sudo apt-get update && sudo apt-get install -y musl-tools
41+
- uses: dtolnay/rust-toolchain@stable
42+
with:
43+
targets: ${{ matrix.target }}
44+
- uses: Swatinem/rust-cache@v2
45+
with:
46+
workspaces: packages/tui
47+
key: ${{ matrix.target }}
48+
- run: cargo build --release --locked --target ${{ matrix.target }}
49+
- name: Inspect binary
50+
run: file target/${{ matrix.target }}/release/codework-tui
51+
- if: runner.os == 'Linux'
52+
name: Require a static binary
53+
run: file target/${{ matrix.target }}/release/codework-tui | grep -E "static(-pie)? linked|statically linked"
54+
- uses: actions/upload-artifact@v4
55+
with:
56+
name: ${{ matrix.package }}
57+
path: packages/tui/target/${{ matrix.target }}/release/codework-tui
58+
if-no-files-found: error
59+
retention-days: 7

‎CLAUDE.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,4 @@ Flow:
8787
3. `git push && git push --tag`.
8888
4. `pnpm release:aikit:dry` to preview the tarball, then `pnpm release:aikit` to publish. Use `pnpm release:aikit:dev` for a prerelease under the `dev` dist-tag.
8989

90-
A workspace dependency is published at its manifest version, which must already be on the registry. A dependency with only dev builds (e.g. plugin, when releasing harness) is pinned explicitly, as a version or a dist-tag resolved at publish time — there is no implicit fallback: `pnpm release:harness:dev --dep @codeworksh/plugin@dev`. Release in dependency order: aikit → plugin → harness → cli.
90+
A workspace dependency is published at its manifest version, which must already be on the registry. A dependency with only dev builds (e.g. plugin, when releasing harness) is pinned explicitly, as a version or a dist-tag resolved at publish time — there is no implicit fallback: `pnpm release:harness:dev --dep @codeworksh/plugin@dev`. Release in dependency order: aikit → plugin → harness → tui platform packages (`tui-<os>-<arch>`) → tui → cli. The TUI's platform packages carry prebuilt binaries built by `.github/workflows/tui.yml` (macOS arm64/x64, Linux arm64/x64 static musl; Unix only) and ship in lockstep with `@codeworksh/tui`; `pnpm bump:tui` moves all five versions. Canary (push to `canary`) builds and publishes the whole chain.

‎package.json‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"bump:cli": "pnpm --filter @codeworksh/cli run bump",
1919
"bump:harness": "pnpm --filter @codeworksh/harness run bump",
2020
"bump:plugin": "pnpm --filter @codeworksh/plugin run bump",
21+
"bump:tui": "pnpm --filter @codeworksh/tui run bump",
2122
"check": "vp check",
2223
"check:packages": "vp run -r check",
2324
"dev:desktop": "pnpm --filter @codeworksh/desktop dev",
@@ -36,6 +37,9 @@
3637
"release:plugin": "pnpm --filter @codeworksh/plugin run release",
3738
"release:plugin:dev": "pnpm --filter @codeworksh/plugin run release:dev",
3839
"release:plugin:dry": "pnpm --filter @codeworksh/plugin run release:dry",
40+
"release:tui": "pnpm --filter @codeworksh/tui run release",
41+
"release:tui:dev": "pnpm --filter @codeworksh/tui run release:dev",
42+
"release:tui:dry": "pnpm --filter @codeworksh/tui run release:dry",
3943
"test": "vp test",
4044
"test:packages": "vp run -r test",
4145
"typecheck": "vp run -r --concurrency-limit 2 typecheck"

‎packages/tui/bump.config.ts‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { defineConfig } from "bumpp";
2+
3+
// Release config for @codeworksh/tui, loaded automatically by `bumpp`. The platform
4+
// packages ship in lockstep with the launcher, so all five versions move together.
5+
export default defineConfig({
6+
files: ["package.json", "npm/*/package.json"],
7+
tag: "@codeworksh/tui@%s",
8+
commit: "release: @codeworksh/tui@%s",
9+
push: false,
10+
});
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# @codeworksh/tui-darwin-arm64
2+
3+
The prebuilt CodeWork terminal UI for macOS on Apple silicon. Installed automatically with `@codeworksh/cli`; run it with `codework tui`.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "@codeworksh/tui-darwin-arm64",
3+
"version": "0.0.1",
4+
"description": "The CodeWork terminal UI binary for macOS on Apple silicon",
5+
"homepage": "https://www.codework.sh",
6+
"license": "MIT",
7+
"repository": {
8+
"type": "git",
9+
"url": "git+https://github.com/codeworksh/codework.git",
10+
"directory": "packages/tui/npm/darwin-arm64"
11+
},
12+
"os": [
13+
"darwin"
14+
],
15+
"cpu": [
16+
"arm64"
17+
],
18+
"publishConfig": {
19+
"access": "public"
20+
},
21+
"scripts": {
22+
"build": "node ../../scripts/stage.mjs"
23+
}
24+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# @codeworksh/tui-darwin-x64
2+
3+
The prebuilt CodeWork terminal UI for macOS on Intel. Installed automatically with `@codeworksh/cli`; run it with `codework tui`.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "@codeworksh/tui-darwin-x64",
3+
"version": "0.0.1",
4+
"description": "The CodeWork terminal UI binary for macOS on Intel",
5+
"homepage": "https://www.codework.sh",
6+
"license": "MIT",
7+
"repository": {
8+
"type": "git",
9+
"url": "git+https://github.com/codeworksh/codework.git",
10+
"directory": "packages/tui/npm/darwin-x64"
11+
},
12+
"os": [
13+
"darwin"
14+
],
15+
"cpu": [
16+
"x64"
17+
],
18+
"publishConfig": {
19+
"access": "public"
20+
},
21+
"scripts": {
22+
"build": "node ../../scripts/stage.mjs"
23+
}
24+
}

0 commit comments

Comments
 (0)