Skip to content

chore(release): truthful versioning + changelog/git commit-back - #5

Merged
mikehardy merged 2 commits into
mainfrom
chore/release-hygiene
Sep 24, 2026
Merged

mikehardy merged 2 commits into
mainfrom
chore/release-hygiene

Conversation

@mikehardy

Copy link
Copy Markdown
Collaborator

Addresses the release/version-drift smells (queue item F2): the committed package.json said 0.1.0 while npm latest was 0.2.1, there was no in-repo CHANGELOG.md, and v0.1.0 had no GitHub Release.

Root cause

The release setup deliberately omitted @semantic-release/git, so @semantic-release/npm bumped the version only inside the published tarball and never committed it back. Versions are computed from git tags, so publishing worked, but the repo's package.json stayed frozen at the 0.1.0 scaffold value. 0.2.0 was a trusted-publish smoke test whose commit was typed feat:, which burned a real minor — and that is the version RNFB/RNGMA happened to pin.

What this changes (going forward)

  • @semantic-release/changelog + @semantic-release/git added to release.config.js. Future releases prepend CHANGELOG.md and commit the bumped package.json + changelog back to main, tagging that commit — so a checkout at any v* tag is truthful.
  • The git commit-back message carries [skip ci].

What this changes (retro)

  • package.json 0.1.0 -> 0.2.1 to match the published npm latest. (Chose the truthful current version over 0.0.0-development; from the next release on, the git plugin keeps it accurate automatically.)
  • New CHANGELOG.md reconstructed from git history + existing GitHub Releases, covering 0.1.0/0.2.0/0.2.1, with a note that 0.2.0 was a publishing smoke test.
  • Created the missing v0.1.0 GitHub Release retroactively (out of band; v0.2.1 remains "Latest").
  • docs/releasing.mdx documents the commit-back model.

⚠️ Required repo-admin follow-up (not doable in a PR)

@semantic-release/git pushes to protected main. The default GITHUB_TOKEN cannot bypass required PRs, so the release workflow needs a token allowed to bypass branch protection (a GitHub App / fine-grained PAT, or adding the release bot to "Allow specified actors to bypass required pull requests" on the main ruleset). Until that is set, the git step of a real release would fail.

Not done here (deliberate — needs a decision)

The queue mentioned retconning tags onto synthesized bump commits via a full history rewrite. The existing tags already point at the correct published SHAs (v0.2.1 -> 52b6c18 = npm's gitHead). A full rewrite would re-point every SHA (dangling the npm gitHead references and orphaning open PRs) for a cosmetic gain. Recommend not rewriting history; adopt the truthful model from here forward instead. See PR discussion.

Validation

  • release.config.js loads; both new plugins resolve.
  • package.json version reads 0.2.1.

- package.json: 0.1.0 -> 0.2.1 so the committed version matches the
  published npm latest instead of the frozen scaffold value.
- Add @semantic-release/changelog + @semantic-release/git so future
  releases prepend CHANGELOG.md and commit the bump back to main,
  tagging that commit (checkout at any tag is now truthful).
- Add a reconstructed CHANGELOG.md covering 0.1.0/0.2.0/0.2.1, noting
  that 0.2.0 was a trusted-publish smoke test that burned a minor.
- docs/releasing.mdx: document the commit-back model and the branch
  protection bypass the release workflow now requires.

Note: the release workflow needs a token allowed to bypass main's
protected-branch rule for the git commit-back step (repo-admin action).
@semantic-release/git now commits the version + CHANGELOG back to the
protected main branch. Consume the repo secret GH_TOKEN (admin PAT) on
checkout and as GH_TOKEN/GITHUB_TOKEN for semantic-release, and set a
release git identity — mirroring invertase/react-native-google-mobile-ads
(semantic-release) and react-native-firebase (Lerna). Also set
npm_config_workspaces_update=false so npm version does not choke on
Yarn workspace: protocols during the bump.

Requires adding GH_TOKEN as a repo secret (documented in releasing.mdx).
@mikehardy
mikehardy force-pushed the chore/release-hygiene branch from 7098a77 to c02b173 Compare September 24, 2026 20:22
@codecov

codecov Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.85%. Comparing base (c25c381) to head (c02b173).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main       #5   +/-   ##
=========================================
  Coverage     58.85%   58.85%           
  Complexity       15       15           
=========================================
  Files            22       22           
  Lines          1016     1016           
  Branches        230      230           
=========================================
  Hits            598      598           
  Misses          346      346           
  Partials         72       72           
Flag Coverage Δ
e2e-android 81.70% <ø> (ø)
e2e-ios-dynamic 90.62% <ø> (ø)
e2e-ios-static 63.07% <ø> (ø)
unit-js 52.61% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mikehardy
mikehardy merged commit 7d8210f into main Sep 24, 2026
13 of 14 checks passed
@mikehardy
mikehardy deleted the chore/release-hygiene branch September 24, 2026 21:05
@mikehardy

Copy link
Copy Markdown
Collaborator Author

🎉 This PR is included in version 0.2.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant