feat: add semantic-release for automatic versioning#50
Conversation
- Add semantic-release with conventional commits analyzer - Auto-bump version based on commit prefixes (feat: minor, fix: patch) - Auto-generate CHANGELOG.md entries - Auto-publish to npm and create GitHub releases - Remove redundant npm-publish workflow Commit prefix rules: - feat: → minor version bump (0.x.0) - fix:/perf:/refactor: → patch version bump (0.0.x) - BREAKING CHANGE: → major version bump (x.0.0) - docs:/style:/chore:/test:/ci: → no release Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> AI-Agent: Claude-Code/2.1.42 AI-Model: claude-opus-4-5-20251101
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughThe PR transitions the repository's release pipeline from manual npm publishing triggered on PR merges to a semantic-release-based automated system triggered on pushes to main. It removes the legacy npm-publish workflow, introduces semantic-release configuration, and refactors the release-on-merge workflow accordingly. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull request overview
This PR modernizes the release process by replacing manual version bumping with automated semantic-release, which analyzes conventional commits to determine version bumps and automatically publishes releases.
Changes:
- Adds semantic-release automation with conventional commit analysis
- Consolidates release workflow into a single semantic-release-based pipeline
- Removes redundant npm-publish workflow (semantic-release handles this)
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| package.json | Adds semantic-release and related plugins as devDependencies |
| .releaserc.json | Configures semantic-release with conventional commit rules, changelog generation, and automated npm/GitHub publishing |
| .github/workflows/release-on-merge.yml | Replaces manual release workflow with semantic-release automation, triggers on push to main |
| .github/workflows/npm-publish.yml | Removed (redundant with semantic-release handling npm publish) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Build | ||
| run: npm run build | ||
|
|
||
| - name: Run tests | ||
| run: npm test |
There was a problem hiding this comment.
The Release workflow duplicates build and test steps that already run in the CI workflow. Both workflows trigger on push to main, causing redundant test execution. Consider either:
- Remove the build/test steps from this workflow and add a
needs: testdependency on the CI workflow's test job, or - Prevent the CI workflow from running on push to main when the Release workflow runs (e.g., by checking commit message for '[skip ci]' or using path filters)
Option 1 is generally preferred as it ensures tests pass before release without duplicating work.
| "changelogFile": "CHANGELOG.md", | ||
| "changelogTitle": "# Changelog\n\nAll notable changes to this project will be documented in this file.\n\nThe format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),\nand this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html)." | ||
| }], | ||
| "@semantic-release/npm", |
There was a problem hiding this comment.
Consider adding explicit npm publish configuration to ensure public access. While unscoped packages default to public access, it's safer to be explicit. You can either:
- Add to package.json:
"publishConfig": { "access": "public" } - Or configure the semantic-release npm plugin in .releaserc.json:
["@semantic-release/npm", { "npmPublish": true, "pkgRoot": "." }]
Option 1 is generally preferred as it's more visible and matches the previous workflow's --access public flag.
| "@semantic-release/npm", | |
| ["@semantic-release/npm", { "npmPublish": true, "pkgRoot": "." }], |
Summary
Adds semantic-release to automatically version and publish releases based on conventional commits.
How it works:
main, semantic-release analyzes commits since last releaseCHANGELOG.md,package.jsonVersion bump rules:
feat:fix:,perf:,refactor:BREAKING CHANGE:docs:,chore:,test:,ci:Changes:
.releaserc.jsonwith semantic-release configrelease-on-merge.ymlto use semantic-releasenpm-publish.yml(semantic-release handles this)semantic-release,@semantic-release/changelog,@semantic-release/git,conventional-changelog-conventionalcommitsTest plan
feat:but we may want to manually tag first)🤖 Generated with Claude Code
Summary by CodeRabbit