ci: add semantic-release workflow ported from @harperfast/vite - #54
Merged
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces release and commit linting configurations by adding .releaserc.json and commitlint.config.cjs, and updates package.json with a prepublishOnly script. Feedback suggests adding a publishConfig block to package.json to ensure the scoped package is published publicly, and removing the non-standard feature commit type from .releaserc.json to align with the commitlint rules.
Bring the release automation from the sibling `@harperfast/vite` plugin so merges to `main` cut versioned releases and publish to npm automatically. - `.github/workflows/release.yaml` — semantic-release on push to `main` (and via merge queue / manual dispatch), publishing to npm with provenance (`id-token: write` + `NPM_CONFIG_PROVENANCE`). Runs under a `Release` environment. Gated on `npm run build` (`dist/` is gitignored and rebuilt on publish via `prepublishOnly`, so this fails a broken build before it ships). - `.github/workflows/verify-commits.yaml` + `commitlint.config.cjs` — enforce the conventional commits that semantic-release parses for version bumps. - `.releaserc.json` — semantic-release config (commit-analyzer, release notes, npm, git, github), matching vite. - `package.json` — add `prepublishOnly: "npm run build"` so `npm publish` (invoked by @semantic-release/npm) compiles `dist/` in CI. Adapted from vite: the `github.repository` guard targets `HarperFast/nextjs`, and the pre-release gate is `npm run build` (vite's `format:check` / `test:coverage` scripts don't exist here yet). Action SHAs are pinned as in vite. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
`@harperfast/nextjs` is a scoped package, which npm publishes with restricted access by default — the automated release would fail with 402 Payment Required on a fresh publish. Add `publishConfig.access = "public"`, matching `@harperfast/vite` (this was missing from the initial port). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
dawsontoth
force-pushed
the
claude/nextjs-release-workflow
branch
from
July 23, 2026 14:20
a08daae to
f464411
Compare
`feature` is not a valid @commitlint/config-conventional type, so a `feature:` commit can never pass the Verify Commits workflow — the release-notes-generator mapping for it is dead config that contradicts our commitlint rules. Drop it and rely on the standard `feat` type. Mirrors the same cleanup in @harperfast/vite. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
cb1kenobi
approved these changes
Jul 23, 2026
Contributor
Author
|
release failed, perfect! I'll open a new PR with a triage. Always great to learn. |
|
🎉 This PR is included in version 2.2.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brings the release automation from the sibling
@harperfast/viteplugin into this repo, so merges tomaincut versioned releases and publish to npm automatically. Independent of and parallel to #53.What's added
.github/workflows/release.yamlmain(+ merge queue / manual dispatch). Publishes to npm with provenance (id-token: write+NPM_CONFIG_PROVENANCE: true), under aReleaseGitHub environment..github/workflows/verify-commits.yamlcommitlint.config.cjs.releaserc.jsonpackage.jsonprepublishOnly: "npm run build".Adaptations from vite (otherwise verbatim)
if: github.repository == 'HarperFast/nextjs' ....npm run build. Vite gates onformat:check+test:coverage; neither script exists onnextjs'smainyet (adding Prettier tooling would mean reformatting the whole repo — out of scope for a clean release PR).npm run buildrunstscand fails a broken build before it publishes.Why
prepublishOnlyis requireddist/is gitignored, so afternpm ciin CI it doesn't exist. Thefilesallowlist publishesdist/**, so@semantic-release/npm(which runsnpm publish) must rebuild it first —prepublishOnlydoes that.Before this can publish (owner setup — noted, not done here)
ReleaseGitHub environment.Follow-ups (not blocking)
npm test+ unit tests) and/or Prettier tooling is added, the release gate can be extended to match vite (format:check+ tests), and vite'sverify-pr.yamlCI matrix could be ported too.integration-tests.ymlis left untouched (stillif: false).🤖 Generated with Claude Code