Skip to content

Commit a4e6847

Browse files
authored
publish.yml: wire 2.0 cutover release flow with platform packages (#362)
* publish.yml: wire 2.0 cutover release flow with platform packages Restructure the release pipeline for the 2.0 cutover (epic #240): - Convert cli-build.yml + napi-build.yml to reusable workflows so the publish workflow can dispatch them via `uses:`. Drops the stub publish jobs that lived inside each. - Update publish.yml to ship 11 npm packages in lockstep: - 3 TS-only umbrellas (relayburn, @relayburn/sdk napi umbrella, @relayburn/mcp) - 4 prebuilt CLI platform packages (@relayburn/cli-<short>) - 4 prebuilt SDK napi platform packages (@relayburn/sdk-<short>) - Drop the 5 retiring TS packages (reader, ledger, analyze, ingest, cli) from the publish loop. Their source dirs stay (cli-golden + conformance fixture seeder still consume them); deprecation is a manual post-cutover step. - New publish job downloads artifacts from the build-cli + build-sdk reusable workflows and stages them into per-platform package dirs before pack/publish: `burn` binary → `packages/relayburn/npm/<short>/bin/`, `relayburn-sdk.<short>.node` → `packages/sdk-node/npm/<short>/`. - Use `npm pack` for non-workspace packages (umbrellas + platform packages live outside the pnpm workspace per pnpm-workspace.yaml's excludes); keep `pnpm pack` for `@relayburn/mcp` so workspace:* gets rewritten. - Publish order: platform packages → umbrellas, so post-publish `npm install relayburn` (or `@relayburn/sdk`) can resolve all four optionalDependencies immediately. - Tag scheme: `<key>-v<ver>` per npm target (e.g. `relayburn-v2.0.0`, `cli-darwin-arm64-v2.0.0`). Canonical release tag is `relayburn-v<ver>`, used by create-release. crates.io tags `relayburn-{sdk,cli}-v<ver>` emitted once per run. - Sync optionalDependencies on both umbrellas (`relayburn` for cli-*, `@relayburn/sdk` napi umbrella for sdk-*) at bump time. - Skip changelog generation for platform packages (they're implementation detail tracking the umbrella version); umbrellas + mcp keep the hand-curated `[Unreleased]` → `[x.y.z] - DATE` promotion. Also: extend `.gitignore` to cover staged napi `.node` files in per-platform sdk-node directories, and trim the verify-publish package choices to the post-cutover three (relayburn, @relayburn/sdk, @relayburn/mcp). * publish.yml: fix CLI artifact download path to match upload-artifact@v4 hierarchy CodeRabbit (PR #362 review) flagged that upload-artifact@v4 preserves the full directory structure for single-file uploads, so the CLI binary lands at /tmp/cli-artifacts/relayburn-cli-<short>/packages/relayburn/npm/<short>/bin/burn rather than the artifact root. The previous cli_src path would never resolve at staging time, halting the publish run on the first matrix leg. The SDK leg is unaffected because it uploads via a glob (packages/sdk-node/src/*.node), and globs strip the path up to the first wildcard.
1 parent dfa5498 commit a4e6847

5 files changed

Lines changed: 475 additions & 283 deletions

File tree

.github/workflows/cli-build.yml

Lines changed: 8 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name: cli build
22

33
# Build prebuilt `burn` binaries for every platform we publish to npm under
4-
# `@relayburn/cli-*`. PRs validate the matrix; tags / manual dispatch *would*
5-
# publish, but the publish step is stubbed off for now — the cutover publish
6-
# workflow integration lands as a follow-up to this PR.
4+
# `@relayburn/cli-*`. PRs validate the matrix; the cutover publish workflow
5+
# (`.github/workflows/publish.yml`) calls this workflow via `workflow_call`
6+
# to produce the binaries it then stages into per-platform packages.
77
#
88
# Mirrors `.github/workflows/napi-build.yml`: the napi-rs SDK uses the same
99
# umbrella + per-platform-package shape, just with `.node` artifacts instead
@@ -30,11 +30,11 @@ on:
3030
- 'packages/relayburn/**'
3131
- '.github/workflows/cli-build.yml'
3232
workflow_dispatch:
33-
inputs:
34-
publish:
35-
description: 'Publish prebuilt artifacts to npm under the `next` tag (stubbed; full wiring lands with the cutover publish workflow)'
36-
type: boolean
37-
default: false
33+
workflow_call:
34+
# Publish runs the same matrix this workflow exercises on PRs. The
35+
# caller downloads the uploaded `relayburn-cli-<short>` artifacts and
36+
# stages them into `packages/relayburn/npm/<short>/bin/` before
37+
# `npm pack` + `npm publish`.
3838

3939
permissions:
4040
contents: read
@@ -169,31 +169,3 @@ jobs:
169169
./packages/relayburn
170170
NODE_PATH="$smoke_dir/node_modules" "$umbrella_dir/node_modules/.bin/burn" --help
171171
NODE_PATH="$smoke_dir/node_modules" "$umbrella_dir/node_modules/.bin/burn" --version
172-
173-
publish:
174-
# Stub. Real publish wiring lands as a follow-up that integrates with
175-
# `.github/workflows/publish.yml`: download the matrix artifacts, drop
176-
# each into the right `packages/relayburn/npm/<short>/bin/` directory,
177-
# and `npm publish` the umbrella + each per-platform package via OIDC
178-
# trusted publisher. Until then, calling `workflow_dispatch` with
179-
# `publish: true` exercises the artifact download path so we catch
180-
# wiring errors early without actually pushing to npm.
181-
needs: build
182-
if: github.event_name == 'workflow_dispatch' && github.event.inputs.publish == 'true'
183-
runs-on: ubuntu-latest
184-
permissions:
185-
contents: read
186-
id-token: write
187-
steps:
188-
- name: Checkout
189-
uses: actions/checkout@v6
190-
191-
- name: Download all artifacts
192-
uses: actions/download-artifact@v4
193-
with:
194-
path: packages/relayburn/npm-artifacts
195-
196-
- name: Inspect artifacts (publish stub)
197-
run: |
198-
echo 'Publish step is currently a stub. Full wiring lands in the cutover publish.yml integration follow-up.'
199-
ls -lahR packages/relayburn/npm-artifacts || true

.github/workflows/napi-build.yml

Lines changed: 9 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
name: napi build
22

33
# Build prebuilt napi-rs `.node` artifacts for every platform we publish to
4-
# npm under `@relayburn/sdk-*`. PRs validate the matrix; tags / manual
5-
# dispatch *would* publish, but the publish step is stubbed off for now —
6-
# wired up properly in #249 (cutover release workflow).
4+
# npm under `@relayburn/sdk-*`. PRs validate the matrix; the cutover publish
5+
# workflow (`.github/workflows/publish.yml`) calls this workflow via
6+
# `workflow_call` to produce the `.node` files it then stages into
7+
# per-platform packages.
78
#
89
# Caches Cargo registry + git + target dir, plus pnpm store, so the matrix
910
# stays fast on the hot path.
@@ -29,11 +30,11 @@ on:
2930
- 'rust-toolchain.toml'
3031
- '.github/workflows/napi-build.yml'
3132
workflow_dispatch:
32-
inputs:
33-
publish:
34-
description: 'Publish prebuilt artifacts to npm under the `next` tag (stubbed; full wiring in #249)'
35-
type: boolean
36-
default: false
33+
workflow_call:
34+
# Publish runs the same matrix this workflow exercises on PRs. The
35+
# caller downloads the uploaded `relayburn-sdk-<short>` artifacts and
36+
# stages them into `packages/sdk-node/npm/<short>/` before
37+
# `npm pack` + `npm publish`.
3738

3839
permissions:
3940
contents: read
@@ -220,40 +221,3 @@ jobs:
220221
env:
221222
RELAYBURN_SDK_NAPI_BUILT: '1'
222223
run: node --test 'test/conformance.test.js'
223-
224-
publish:
225-
# Stub. Real publish wiring lands in #249 (Wave 3 cutover) — at that
226-
# point this job downloads the matrix artifacts, drops each into the
227-
# right `npm/<platform>/` directory, and runs `npm publish --tag=next`
228-
# for the umbrella + each per-platform package via OIDC trusted
229-
# publisher. Until then, calling `workflow_dispatch` with
230-
# `publish: true` exercises the artifact download path so we catch
231-
# wiring errors early without actually pushing to npm.
232-
needs: build
233-
if: github.event_name == 'workflow_dispatch' && github.event.inputs.publish == 'true'
234-
runs-on: ubuntu-latest
235-
permissions:
236-
contents: read
237-
id-token: write
238-
steps:
239-
- name: Checkout
240-
uses: actions/checkout@v6
241-
242-
- name: Setup pnpm
243-
uses: pnpm/action-setup@v5
244-
245-
- name: Setup Node
246-
uses: actions/setup-node@v6
247-
with:
248-
node-version: '22.14.0'
249-
cache: 'pnpm'
250-
251-
- name: Download all artifacts
252-
uses: actions/download-artifact@v4
253-
with:
254-
path: packages/sdk-node/artifacts
255-
256-
- name: Inspect artifacts (publish stub)
257-
run: |
258-
echo 'Publish step is currently a stub. Full wiring lands in #249.'
259-
ls -lah packages/sdk-node/artifacts || true

0 commit comments

Comments
 (0)