chore(release): enable first publish (version floor 9.29.1 + minor changeset + canary path)#41
Conversation
…ngeset, canary path) Queues the first publish of @wdio/browserstack-service from this repo and adds a canary validation path: - package.json: version 9.28.0 -> 9.29.1 (align to npm `latest` so the changeset bump lands above it; a bump from 9.28.0 would be <= 9.29.1 and npm would reject it). - .changeset: add a minor changeset (ported LTS + Test-Case-ID features + fixes) -> the "Version Packages" PR will compute 9.30.0. - .changeset/config.json: snapshot.useCalculatedVersion=true so canary versions read <next>-canary-<datetime> (e.g. 9.30.0-canary-...). - release.yml: add a workflow_dispatch `canary` input; the normal changesets/action step is gated to push events, and a new canary step snapshot-publishes pending changesets to the `canary` dist-tag via the SAME OIDC trusted publisher (validates OIDC + provenance without touching `latest`). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
| # Normal release (push to main / v8): open the "Version Packages" PR, or once that PR is | ||
| # merged, publish to latest (main) / v8 (v8 branch, via publishConfig.tag). | ||
| - name: Create Release PR or publish to npm | ||
| if: github.event_name == 'push' |
There was a problem hiding this comment.
why we added the trigger on push?
There was a problem hiding this comment.
Good question — it's intentional, and it's the standard Changesets release flow. The on: push: to main/v8 is what makes a release happen at all, and it drives both halves:
- Merge a PR that carries a pending changeset → push to
main→changesets/actionsees the pending changeset and opens/updates the "Version Packages" PR (bumps version + CHANGELOG). It does not publish yet. - Merge that "Version Packages" PR → this is another push to
main, now with no pending changesets → the same action runschangeset publish→ publishes to npm (latest).
Without the push trigger, nothing would ever version or publish. The if: github.event_name == 'push' on this step just scopes it to that normal flow so it does not fire on the manual workflow_dispatch canary run — that's the separate step below (if: github.event_name == 'workflow_dispatch' && inputs.canary). The two steps are mutually exclusive by event type.
(No NPM_TOKEN anywhere — auth is OIDC trusted publishing via the id-token: write permission.)
There was a problem hiding this comment.
Update: based on this, we've made publishing manual (pushed as c9f1ed8). The push trigger now does strictly one thing — open/update the "Version Packages" PR in version-only mode. It never publishes, and merging the Version PR is now a no-op.
Publishing is a separate manual step: Actions → Release → Run workflow → publish: true (main → latest, v8 → v8), with git tag + GitHub release + provenance over the same OIDC publisher. Canary is unchanged (canary: true).
So the answer to "why on push?" is now: only to keep the version/changelog PR up to date automatically — nothing reaches npm without someone clicking Run workflow.
| - name: Canary publish to `canary` dist-tag | ||
| if: github.event_name == 'workflow_dispatch' && inputs.canary | ||
| run: | | ||
| npx changeset version --snapshot canary | ||
| npx changeset publish --no-git-tag --tag canary | ||
| env: | ||
| NPM_CONFIG_PROVENANCE: 'true' |
There was a problem hiding this comment.
Did we test these commands?
There was a problem hiding this comment.
Fair question. Honest status: the flags and config are verified, but the commands have not been run end-to-end yet — that's exactly what the manual canary run is for, and it's designed to be safe.
What's verified:
changeset version --snapshot canarywithsnapshot.useCalculatedVersion: truein.changeset/config.json→ produces9.30.0-canary-<datetime>(the workspace pkg is at9.29.1; twominorchangesets →9.30.0). Snapshot mode also auto-disables committing and does not consume the changeset, so it stays on the branch for the real release afterward.changeset publish --no-git-tag --tag canary— both flags confirmed valid against@changesets/cli(its usage string is literallypublish [--tag <name>] [--otp <code>] [--no-git-tag]; we resolve 2.31.x from^2.27.9).--tag canarypublishes under thecanarydist-tag (neverlatest);--no-git-tagskips git tag creation, which is right for an ephemeral canary.
Why running it live is safe (it IS the test): it only publishes a prerelease to the canary dist-tag; latest (currently 9.29.1) is untouched; and any OIDC/provenance misconfig makes the publish step fail cleanly — no bad latest can escape.
To validate end-to-end: Actions → Release → Run workflow → canary: true, then:
npm view @wdio/browserstack-service@canary version # -> 9.30.0-canary-...
npm view @wdio/browserstack-service@canary dist.attestations # provenance present
npm view @wdio/browserstack-service dist-tags.latest # still 9.29.1
…PR, publish is workflow_dispatch Split the single changesets step into two: - push to main/v8 runs changesets in version-only mode (opens/updates the "Version Packages" PR; never publishes — merging that PR is now a no-op). - Publishing is a manual workflow_dispatch input (publish=true): changeset publish -> npm (main -> latest, v8 -> v8) with git tag + GitHub release + provenance over the same OIDC trusted publisher. Canary path unchanged. Addresses review: publishing no longer happens automatically on a merge. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
9629eec
into
migration/monorepo-add-wdio-browserstack-service
Queues the first publish of
@wdio/browserstack-servicefrom this repo and adds a canary validation path. Base = PR #37 branch so it flows in with the conversion.Changes
packages/browserstack-service/package.json9.28.0→9.29.1. npmlatestis9.29.1; a changeset bump from9.28.0would be ≤ that and npm would reject it. Aligning to9.29.1means the minor changeset lands9.30.0.9.30.0"Version Packages" PR..changeset/config.json—snapshot.useCalculatedVersion: trueso canary versions read9.30.0-canary-<datetime>.release.yml— add aworkflow_dispatchcanaryinput; the normalchangesets/actionstep is gated topush, and a new step snapshot-publishes pending changesets to thecanarydist-tag via the same OIDC trusted publisher — validating OIDC + provenance end-to-end without touchinglatest.After merge (→ eventually
main)canary: trueto publish9.30.0-canary-*to thecanarytag and confirm OIDC/provenance.9.30.0"Version Packages" PR; merging it publishes9.30.0tolatest.Note: pushed via SSH — the workflow-file change needs
workflowscope (the HTTPS/OAuth push was rejected), so future edits torelease.ymlmust go via SSH or the web UI.🤖 Generated with Claude Code