Skip to content

ci: automated release, gated on CI passing on main - #2

Merged
karngyan merged 3 commits into
mainfrom
claude/ci-fixes-improvements-169bk6
Jun 26, 2026
Merged

ci: automated release, gated on CI passing on main#2
karngyan merged 3 commits into
mainfrom
claude/ci-fixes-improvements-169bk6

Conversation

@karngyan

@karngyan karngyan commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

Why

Keep the ergonomic changesets flow (no manual button), but make sure a red main can never publish.

How the release flow works now

  1. Add a changeset in your feature PR (pnpm changeset) and merge to main.
  2. CI runs on main. Only if it succeeds, the Release workflow fires (via workflow_run) and opens/updates a "Version Packages" PR.
  3. Review and merge that PR → CI runs again → on success, Release publishes to npm + tags.

You never click "Run workflow" — you just merge PRs. Publishing is gated behind merging the Version Packages PR and CI being green.

What changed

 on:
-  push:
-    branches: [main]
+  workflow_run:
+    workflows: [CI]
+    branches: [main]
+    types: [completed]

 jobs:
   release:
+    if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push' }}
  • fetch-depth: 0 added so changesets can read full history for the changelog.
  • mise toolchain + manual ~/.npmrc auth (from the earlier CI work) carried over.

Notes

  • Publishing needs the NPM_TOKEN secret. Until it's set, the Version-PR automation works but a publish attempt fails — so nothing ships early by accident.
  • CI is currently green on main (run on merge commit 79be0ed).
  • No manual workflow_dispatch trigger per the chosen "automated only" approach; easy to add later if you ever want a manual escape hatch.

🤖 Generated with Claude Code

https://claude.ai/code/session_018JWDajbftveEqqZWcrFH5n

claude added 2 commits June 26, 2026 16:31
No release has been cut yet, and auto-publishing on every merge to main is
premature. Switch the Release workflow from a push trigger to manual
workflow_dispatch so releases are cut deliberately from the Actions tab.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018JWDajbftveEqqZWcrFH5n
Replace the manual workflow_dispatch trigger with a workflow_run trigger so
the Release workflow runs automatically after CI succeeds on main, and never
when CI is red. This restores the standard changesets flow (merge a changeset
-> "Version Packages" PR -> merge to publish) while ensuring a broken main
cannot publish.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018JWDajbftveEqqZWcrFH5n
@karngyan karngyan changed the title ci: make release manual (workflow_dispatch) ci: automated release, gated on CI passing on main Jun 26, 2026
Remove the premature changeset so merging does not auto-open a Version
Packages PR. A release changeset will be added when we're ready to ship.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018JWDajbftveEqqZWcrFH5n
@karngyan
karngyan merged commit 904d883 into main Jun 26, 2026
1 check 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.

2 participants