ci: tag-triggered npm release workflow for code and pm - #57
Conversation
Publishes @getdevintern/code and @getdevintern/pm to npm when a code-v* / pm-v* tag is pushed (or via workflow_dispatch). Mirrors the pm-desktop release workflow style: matrix job per package, Bun toolchain, tag/version guard, GitHub release with generated notes. - POSTHOG_API_KEY/POSTHOG_HOST injected at job level so any rebuild during publish still bakes the analytics key into dist/index.js - NPM_TOKEN secret written to ~/.npmrc for bun publish
- Add id-token: write permission; publish with the official npm CLI (>= 11.5.1 required for the OIDC exchange) instead of bun publish, which does not support trusted publishing yet - Document per-package trusted-publisher setup on npmjs.com and the first-publish bootstrap (OIDC requires an existing package) - Provenance attestations are attached automatically
|
Switched publishing to npm Trusted Publishing (OIDC) per npm's recommendation — no One-time setup per package on npmjs.com (
Bootstrap caveat: OIDC can't publish a package that doesn't exist yet — if either package has never been published, do the very first publish manually ( Implementation notes:
|
The test relied on real timers: 10ms heartbeats against a 40ms lease gave the event loop only a few scheduling slots, so under CI load one delayed beat let the lease expire and the second acquirer steal the claim. - Inject setInterval/clearInterval into AutomationAcquirer alongside the existing now/setTimer DI hooks - Drive the lease/heartbeat timeline manually with a fake clock; no real timing dependencies remain
|
The failing runs (example) were a workflow-file parse error: I had used Fixed by replacing the matrix with two explicit jobs ( |
Summary
Adds
.github/workflows/npm-release.yml, publishing@getdevintern/codeand@getdevintern/pmto npm, modeled onpm-desktop-release.yml.How to release:
Or run manually via workflow_dispatch (choose
code,pm, orboth).Behavior:
package.jsonversionbun install --frozen-lockfile→bun run build→ typecheck →bun publish --access public)Secrets/variables used (already configured unless noted):
NPM_TOKENPOSTHOG_API_KEY@getdevintern/codebundle at build timePOSTHOG_HOSThttps://us.i.posthog.comNote:
POSTHOG_API_KEY/POSTHOG_HOSTare set at job level so that any rebuild triggered byprepublishOnlyduringbun publishstill bakes the key intodist/index.js(verified locally:bun publish --dry-runre-runs the build).Test plan
bun publish --dry-runverified for both packages from this repo layout (correct files packed:dist/index.js+ dashboard UI assets for code,dist/lib/promptsfor pm)NPM_TOKENsecret, then do a dry release (workflow_dispatch) before cutting a real tag