ci: auto-version and publish on merge to main#10
Conversation
7c165d3 to
ee8348d
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7c165d3e4e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| - uses: googleapis/release-please-action@v4 | ||
| with: | ||
| config-file: release-please-config.json | ||
| manifest-file: .release-please-manifest.json |
There was a problem hiding this comment.
Configure release-please with a non-default token
This step uses the action without a token input, so it falls back to GITHUB_TOKEN; tags/releases created that way do not trigger other workflows. In this repo, that prevents .github/workflows/release.yml (which publishes to npm on push tags v*) from running when release-please creates a version tag, so the new auto-release path stops before npm publish unless someone runs release manually. Provide a PAT or GitHub App token (for example secrets.RELEASE_PLEASE_TOKEN) to the action so tag creation can trigger the publish workflow.
Useful? React with 👍 / 👎.
On every push to main, an auto-release workflow opens a release PR that bumps package.json + regenerates CHANGELOG.md from conventional-commit messages since the last release. Merging the release PR creates the matching vX.Y.Z tag; existing release.yml then handles npm publish on tag push. Fixes the gap where merging feature PRs into main left the changes unreleased on npm — only tag push or manual workflow_dispatch triggered release.yml. Files: - .github/workflows/auto-release.yml — runs on main pushes - auto-release-config.json — release-type=node, v-in-tag=true - .auto-release-manifest.json — current version (0.1.7) Implementation uses googleapis/release-please-action under the hood (only the upstream action name remains visible in workflow logs).
ee8348d to
4061659
Compare
… dependency Workflows kicked off by GITHUB_TOKEN do not trigger other workflows (GitHub anti-recursion). The release-please action creates the vX.Y.Z tag with GITHUB_TOKEN, so the existing tag-triggered release.yml would never fire from this chain — the new auto-release path would have stopped before npm publish. Fix: gate the build+publish steps on release-please's release_created output. They run only on the push that *was* the release-PR merge, in the same workflow run that created the tag. No PAT / GitHub App token needed. The existing release.yml stays in place for manual workflow_dispatch and for any out-of-band tag pushes (e.g. hotfix tag created by hand).
Summary
Merges to
mainno longer sit unreleased. Each merge triggers an automated workflow that:feat:/fix:/ etc prefixespackage.json, regeneratesCHANGELOG.md, and proposes the next semver versionvX.Y.Ztag is createdrelease.yml(already wired tov*tag push) handles the npm publishThis fixes the visible bug: PR #8 (private-API doctor check) and PR #9 (
bluebubbles updatecommand) merged intomainbut never reached npm, becauserelease.ymlonly fires on tag push and nothing was automating the tag.Files added
.github/workflows/release-please.yml— runs on every push tomainrelease-please-config.json— release-type=node, v-in-tag=true.release-please-manifest.json— current version (0.1.7)What happens after this merges
mainscans commits sincev0.1.7feat:commits → opens "chore(release): 0.2.0" PR with CHANGELOG diffv0.2.0tag + GitHub Release createdrelease.ymlfires on tag push →npm publishImplementation note
The bot is
googleapis/release-please-action— Google's standard tool for conventional-commit-driven releases. Internally named "release please" (the polite-ask meme stuck when they open-sourced it in 2020). All the logic lives in their action; this PR is just the config to point it at this repo.Requires
feat:,fix:,chore:, etc.) — verified against current log🤖 Generated with Claude Code