Skip to content

ci: auto-version and publish on merge to main#10

Merged
anmho merged 2 commits into
mainfrom
feat/release-please
May 26, 2026
Merged

ci: auto-version and publish on merge to main#10
anmho merged 2 commits into
mainfrom
feat/release-please

Conversation

@anmho
Copy link
Copy Markdown
Owner

@anmho anmho commented May 26, 2026

Summary

Merges to main no longer sit unreleased. Each merge triggers an automated workflow that:

  1. Scans commits since the last release for feat: / fix: / etc prefixes
  2. Opens (or updates) a "release PR" that bumps package.json, regenerates CHANGELOG.md, and proposes the next semver version
  3. When that release PR is merged, the matching vX.Y.Z tag is created
  4. The existing release.yml (already wired to v* tag push) handles the npm publish

This fixes the visible bug: PR #8 (private-API doctor check) and PR #9 (bluebubbles update command) merged into main but never reached npm, because release.yml only fires on tag push and nothing was automating the tag.

Files added

  • .github/workflows/release-please.yml — runs on every push to main
  • release-please-config.json — release-type=node, v-in-tag=true
  • .release-please-manifest.json — current version (0.1.7)

What happens after this merges

  1. release-please run on main scans commits since v0.1.7
  2. Sees two feat: commits → opens "chore(release): 0.2.0" PR with CHANGELOG diff
  3. You merge that PR → v0.2.0 tag + GitHub Release created
  4. release.yml fires on tag push → npm publish

Implementation 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

  • Commit messages already follow conventional commits (feat:, fix:, chore:, etc.) — verified against current log
  • No npm secrets/config changes — publish still goes through the existing trusted-publishing setup

🤖 Generated with Claude Code

@anmho anmho changed the title ci: add release-please for auto-versioning and npm publish on merge ci: auto-version and publish on merge to main May 26, 2026
@anmho anmho force-pushed the feat/release-please branch from 7c165d3 to ee8348d Compare May 26, 2026 05:07
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread .github/workflows/release-please.yml Outdated
Comment on lines +21 to +24
- uses: googleapis/release-please-action@v4
with:
config-file: release-please-config.json
manifest-file: .release-please-manifest.json
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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).
@anmho anmho force-pushed the feat/release-please branch from ee8348d to 4061659 Compare May 26, 2026 05:07
… 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).
Copy link
Copy Markdown
Owner Author

anmho commented May 26, 2026

Merge activity

  • May 26, 5:56 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • May 26, 5:56 AM UTC: @anmho merged this pull request with Graphite.

@anmho anmho merged commit cb58f86 into main May 26, 2026
2 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