Skip to content

ci: dispatch to unitsml/unitsdb-js on every unitsdb release#31

Merged
ronaldtse merged 1 commit into
mainfrom
chore/notify-unitsdb-js
Jun 29, 2026
Merged

ci: dispatch to unitsml/unitsdb-js on every unitsdb release#31
ronaldtse merged 1 commit into
mainfrom
chore/notify-unitsdb-js

Conversation

@ronaldtse

Copy link
Copy Markdown
Contributor

Summary

Adds notify-unitsdb-js.yml, a cross-repo trigger that fires
repository_dispatch (do-release) to
unitsml/unitsdb-js every
time lib/unitsdb/version.rb changes on main.

unitsml/unitsdb-js is a new release-only repo that publishes the
Opal-compiled unitsdb-ruby bundle to npm as @unitsml/unitsdb. It
was created in conjunction with this change.

What happens end-to-end

  1. release.yml (existing Cimas chain) bumps lib/unitsdb/version.rb
    and tags vX.Y.Z on main.
  2. This workflow sees the version bump, extracts X.Y.Z, and
    dispatches do-release to unitsml/unitsdb-js with payload
    { version, ruby_ref }.
  3. unitsdb-js's release.yml checks out unitsdb-ruby at
    ruby_ref, runs Opal, dumps the bundled database to JSON, wraps
    with an esbuild-built TypeScript façade, and publishes
    @unitsml/unitsdb@X.Y.Z to npm.

Why this shape

  • Separate repo: keeps Ruby and JS tooling/CI/contributors
    cleanly separated; the Ruby repo stays the single source of truth.
  • Trigger via repository_dispatch: matches the gated-chain
    pattern the Cimas release already uses for downstream consumers.
  • Idempotency: unitsdb-js's workflow checks
    npm view @unitsml/unitsdb@VERSION before publishing and skips
    cleanly if the version is already live. Re-dispatching after a
    transient failure just works.

Required secrets

  • UNITSML_CI_PAT_TOKEN (already configured) — used by
    peter-evans/repository-dispatch@v3 for the cross-repo dispatch.
  • NPM_TOKEN — must be set on unitsml/unitsdb-js for the publish
    step. This is not yet in place; please add it before the next
    unitsdb release goes out, otherwise the JS dispatch will fail at
    the publish step.

Test plan

  • CI on this PR passes (workflow file is valid YAML).
  • After merge, the next unitsdb patch release will trigger
    unitsml/unitsdb-js's release.yml. Verify
    @unitsml/unitsdb@<version> appears on npm.
  • Re-triggering the workflow (via workflow_dispatch on
    unitsdb-js) with an already-published version exits cleanly
    with the skip warning.

After every release (which bumps lib/unitsdb/version.rb on main), fire
a repository_dispatch (do-release) to unitsml/unitsdb-js so it can
compile the new version via Opal and publish @unitsml/unitsdb to npm.

unitsdb-js's release workflow is idempotent — it skips cleanly if a
version is already on npm — so re-dispatching after a transient
failure (or manual re-trigger) is always safe.
@ronaldtse ronaldtse merged commit eb0d6b7 into main Jun 29, 2026
19 checks passed
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.

1 participant