-
Notifications
You must be signed in to change notification settings - Fork 0
ci: modernize publish workflow with semantic-release #435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@claude please review this pr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the final PR Bugbot will review for you during this billing cycle
Your free Bugbot reviews will reset on January 27
Details
You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
Replace the outdated Github-Actions-Community/merge-release action with semantic-release, which is the modern, well-maintained standard for automated versioning and npm package publishing. **Why semantic-release?** - Actively maintained with 3000+ GitHub stars - Industry standard for automated releases - Better support for npm trusted publishing with OIDC - Automatic changelog generation - Semantic versioning based on conventional commits - Better error handling and debugging **Changes:** 1. Replace merge-release with cycjimmy/semantic-release-action@v4 2. Add semantic-release configuration (.releaserc.json) 3. Update permissions to allow GitHub integration (contents: write, issues: write, pull-requests: write) 4. Add fetch-depth: 0 for full commit history analysis 5. Configure semantic-release plugins: - @semantic-release/commit-analyzer (analyze commits for version bumping) - @semantic-release/release-notes-generator (generate release notes) - @semantic-release/changelog (maintain CHANGELOG.md) - @semantic-release/npm (publish to npm) - @semantic-release/git (commit version changes back) - @semantic-release/github (create GitHub releases) **Commit Message Format:** Commit messages must follow Conventional Commits format: - feat: new feature → minor version bump - fix: bug fix → patch version bump - BREAKING CHANGE: → major version bump **Benefits:** - ✅ Better npm trusted publishing support with OIDC - ✅ Automatic package provenance - ✅ Professional release notes and changelog - ✅ Semantic versioning automation - ✅ GitHub release integration - ✅ Better error messages and debugging - ✅ Widely used in the JavaScript ecosystem 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
97de1a4 to
049bf17
Compare
Bug Fixes AppliedThanks to cursor bot for catching these issues! I've fixed both bugs: 1. ✅ Invalid JSON Syntax in branches parameterProblem: The workflow had invalid YAML/JSON syntax: branches: |
[
'main'
]Single quotes in JSON arrays are invalid. Solution: Removed the redundant 2. ✅ Branch Condition MismatchProblem: The workflow condition allowed both branches: if: github.event_name == 'push' && ( github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' )But "branches": ["main"]If the workflow triggered on Solution: Simplified the condition to only check for if: github.event_name == 'push' && github.ref == 'refs/heads/main'Changes Made
The workflow should now function correctly with semantic-release! |
Summary
Replace the outdated
Github-Actions-Community/merge-releaseaction with semantic-release, the modern, industry-standard solution for automated versioning and npm package publishing.Problem with merge-release
The current
merge-releaseaction has several limitations:Solution: semantic-release
semantic-release is the industry standard with:
Changes
1. publish.yml Updates
Github-Actions-Community/merge-release@mainwithcycjimmy/semantic-release-action@v4contents: write,issues: write,pull-requests: writefetch-depth: 0to get full commit history for analysisnpm ciinstead of cache (cleaner)2. New .releaserc.json Configuration
Created semantic-release configuration with plugins:
{ "branches": ["main"], "plugins": [ "@semantic-release/commit-analyzer", // Analyze commits for version "@semantic-release/release-notes-generator", // Generate release notes "@semantic-release/changelog", // Create CHANGELOG.md "@semantic-release/npm", // Publish to npm "@semantic-release/git", // Commit version changes "@semantic-release/github" // Create GitHub releases ] }3. Commit Message Format (Conventional Commits)
Releases are triggered automatically based on commit message prefixes:
feat:feat: add new featurefix:fix: resolve bugBREAKING CHANGE:Benefits
Security
Automation
Quality
Maintenance
Permissions
The publish job now requires:
id-token: write- For OIDC token generation (npm trusted publishing)contents: write- For pushing version commits and tagsissues: write- For GitHub integrationpull-requests: write- For GitHub integrationTesting
To test locally:
This will simulate the release process without publishing or pushing.
Migration Notes
The project's existing commit history and future commits should follow Conventional Commits format for automatic version bumping to work correctly:
References
🤖 Generated with Claude Code
Note
Replaces merge-release with semantic-release, updates publish workflow permissions/steps, restricts to main, and adds
.releaserc.jsonfor automated versioning/releases..github/workflows/publish.yml)cycjimmy/semantic-release-action@v4(+@semantic-release/git,@semantic-release/changelog).contents: write,issues: write,pull-requests: write; keepid-token: write.fetch-depth: 0for full history; usenpm ciandnpm run build.mainonly..releaserc.json)package.json,package-lock.json,CHANGELOG.md) and release commit message format.Written by Cursor Bugbot for commit 049bf17. This will update automatically on new commits. Configure here.