Skip to content

ci: release automatically when the release PR is merged - #23

Merged
SongshGeo merged 1 commit into
mainfrom
dev
Aug 5, 2026
Merged

SongshGeo merged 1 commit into
mainfrom
dev

Conversation

@SongshGeo

Copy link
Copy Markdown

Why

PR #22 merged to main and nothing shipped. release.yml only fires on a pushed tag, and the tag came from a manual npm version step — easy to forget. Two fixes sat on main unreleased.

(2.4.0-beta.3 has since been cut by hand and is published with all three assets, so this PR is only about the automation.)

How it works

release-please runs on every push to main. It reads the conventional commits since the last tag and keeps a chore(main): release <version> PR open containing:

  • bumped package.json, package-lock.json, manifest.json, manifest-beta.json, .release-please-manifest.json
  • a generated CHANGELOG.md

Merging that PR is the release. It tags, publishes the GitHub release, then the follow-up jobs build and attach main.js / manifest.json / styles.css and append the versions.json entry.

Merging an ordinary PR — docs, chores, refactors — never mints a version. That is the reason for the release-PR hop rather than "tag every push to main".

Versioning

Configured for the current prerelease line, so fix: on 2.4.0-beta.3 proposes 2.4.0-beta.4. Verified with a dry run against this branch:

❯ release for path: ., version: 2.4.0-beta.3, sha: 72dbae6
✔ updating from 2.4.0-beta.3 to 2.4.0-beta.4
title: chore(dev): release 2.4.0-beta.4
  • Release-As: 2.5.0 in a commit body pins a version by hand.
  • To graduate the beta line to a stable 2.4.0, drop "prerelease": true and "versioning": "prerelease" from release-please-config.json.

versions.json

release-please cannot write it — the key is the version, so no generic file updater fits. The record-version job runs version-bump.mjs, the same script the manual flow uses, and commits the entry. Obsidian reads that file from the default branch rather than from the release, so landing it one commit after the tag is harmless.

Relationship to release.yml

release.yml stays as the manual escape hatch for a hand-pushed tag. A tag created by release-please cannot reach it — GitHub does not re-trigger workflows for refs pushed with GITHUB_TOKEN — so the two paths can never publish the same release twice. Both now carry a header comment saying so, and MAINTAINING.md documents both.

After merging

release-please will immediately open a chore(main): release 2.4.0-beta.4 PR covering this ci: commit. Merge it when you want that version out; it is also the end-to-end test of the new pipeline.

Checked

  • npx release-please release-pr --dry-run against this branch — correct base version, correct next version, all six files updated.
  • Repo settings verified: Actions have write permission and may open PRs; main has no protection rule that would block the record-version push.

🤖 Generated with Claude Code

PR #22 merged to main and nothing shipped: release.yml only fires on a pushed
tag, and the tag was a manual `npm version` step that is easy to forget. Two
fixes sat on main unreleased until someone noticed.

release-please now recomputes the next version from the conventional commits on
main and keeps a release PR open with the bumped package.json, manifest.json,
manifest-beta.json and a generated CHANGELOG.md. Merging that PR is the release:
it tags, publishes, attaches main.js/manifest.json/styles.css, and appends the
versions.json entry. An ordinary merge — docs, chores — cannot mint a version,
which is why this is not simply "tag every push to main".

versions.json is filled in by version-bump.mjs, the same script the manual flow
uses: its key is the version itself, so no generic file updater can write it.
Obsidian reads that file from the default branch rather than from the release,
so landing it one commit after the tag is harmless.

release.yml stays as the manual escape hatch. The tag release-please creates
cannot reach it — GitHub does not re-trigger workflows for refs pushed with
GITHUB_TOKEN — so the two paths can never publish the same release twice.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@SongshGeo
SongshGeo merged commit 2aee5a9 into main Aug 5, 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.

1 participant