Skip to content

ci: publish Cloudflare Worker bundle on tagged release - #11

Merged
evangineer merged 1 commit into
mainfrom
ci/release-worker-bundle
Apr 29, 2026
Merged

evangineer merged 1 commit into
mainfrom
ci/release-worker-bundle

Conversation

@evangineer

Copy link
Copy Markdown
Contributor

Summary

Add a CI workflow that builds a self-contained Cloudflare Worker bundle on every tagged
release and attaches it as a GitHub release artefact. This removes the requirement for
holo-platform-cli to have the joining-service source repo checked out locally — it can
instead download a pinned worker.js + wrangler.toml directly from a release tag and
deploy with wrangler deploy --no-bundle.

Changes

  • .github/workflows/release.yml — new tag-triggered workflow: runs the test suite,
    then builds the Worker bundle with wrangler deploy --dry-run --outfile and uploads
    dist/worker.js and deploy/cloudflare/wrangler.toml to the GitHub release
  • deploy/cloudflare/wrangler.toml — two updates:
    • KV namespace ID placeholders changed from REPLACE_WITH_KV_NAMESPACE_ID to
      __SESSIONS_KV_NAMESPACE_ID__ / __SESSIONS_KV_PREVIEW_NAMESPACE_ID__ (sed-friendly
      for automated substitution by holo-platform-cli)
    • Added compatibility_flags = ["nodejs_compat"] — required because several source
      files (utils.ts, email-code.ts, delegated-verification.ts, lair-signer.ts)
      use node:crypto; without this flag the bundled worker raises runtime errors on
      Cloudflare Workers
  • package.json — add wrangler@^4.86.0 as a devDependency so the workflow uses
    the repo-pinned version
  • package-lock.json — update @holo-host/lair from file: local path to
    https://registry.npmjs.org/@holo-host/lair/-/lair-0.1.2.tgz (0.1.1 had a packaging
    bug where dist/mnemonic.js was missing from the tarball; 0.1.2 is the correct
    published release)

How the platform CLI consumes this

// download pinned release artefacts
const workerUrl = `https://github.com/Holo-Host/joining-service/releases/download/${version}/worker.js`;
const tomlUrl   = `https://github.com/Holo-Host/joining-service/releases/download/${version}/wrangler.toml`;
// substitute KV namespace IDs, then:
// wrangler deploy --no-bundle worker.js -c wrangler.toml

Test plan

  • npm test — 272/273 pass (1 pre-existing Shoelace UI failure unrelated to this change)
  • npm run typecheck — passes
  • wrangler deploy --dry-run --config deploy/cloudflare/wrangler.toml --outfile dist/worker.js — builds cleanly, no warnings, 387 KiB gzip
  • Verified package-lock.json resolves @holo-host/lair from npm registry at 0.1.2 (not file: path)

Closes #10

@evangineer
evangineer requested a review from zippy April 28, 2026 16:47
- Add .github/workflows/release.yml: on v* tag push, run tests then
  build the Worker bundle with wrangler deploy --dry-run --outfile and
  upload worker.js + wrangler.toml as GitHub release artefacts
- Add wrangler@^4 as a devDependency (pinned to ^4.86.0)
- Update deploy/cloudflare/wrangler.toml:
  - KV namespace IDs now use __SESSIONS_KV_NAMESPACE_ID__ and
    __SESSIONS_KV_PREVIEW_NAMESPACE_ID__ placeholders (sed-friendly
    for holo-platform-cli substitution)
  - Add nodejs_compat compatibility flag (resolves node:crypto warnings
    from src/utils.ts, email-code, delegated-verification, lair-signer)
  - Add deploy-from-artefact instructions to comments

Closes #10

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@evangineer
evangineer force-pushed the ci/release-worker-bundle branch from 1432750 to a3d8d23 Compare April 29, 2026 10:57
@evangineer evangineer self-assigned this Apr 29, 2026
@evangineer
evangineer merged commit 388b231 into main Apr 29, 2026
1 check passed
@evangineer
evangineer deleted the ci/release-worker-bundle branch April 29, 2026 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI: publish pre-built Cloudflare Worker bundle as GitHub release artefact

2 participants