Releasing
Releasing
Section titled “Releasing”This guide explains the release process for the Cooperative SDK.
Overview
Section titled “Overview”When code is pushed to the main branch, GitHub Actions automatically:
- Reads the version from
package.json - Checks if it changed from the last release
- Builds the package
- Generates a changelog from commit messages
- Creates a GitHub release with the tag
vX.Y.Z
Release Workflow
Section titled “Release Workflow”1. Update Version Automatically
Section titled “1. Update Version Automatically”Use the version bump script:
# Bump version based on commitspnpm run version:bump
# See what would happen firstpnpm run version:dry-runThe script analyzes commit messages and updates package.json automatically.
Version bump rules:
feat:commits → bump MINOR version (0.1.0 → 0.2.0)fix:commits → bump PATCH version (0.1.0 → 0.1.1)- Breaking changes → bump MAJOR version (0.1.0 → 1.0.0)
Manual Version (Alternative)
Section titled “Manual Version (Alternative)”{ "version": "0.1.1" // Set manually if needed}2. Merge to Main
Section titled “2. Merge to Main”# Ensure you're on develop branchgit checkout develop
# Update with latest changesgit pull origin develop
# Merge to maingit checkout maingit merge developgit push origin main3. Verify Release
Section titled “3. Verify Release”Check the GitHub Releases page:
- ✅ Tag matches package.json version (e.g.,
v0.1.1) - ✅ Changelog is accurate
- ✅ Release is published
Commit Message Convention
Section titled “Commit Message Convention”Use conventional commits for automatic changelog generation:
Feature (bumps MINOR version)
Section titled “Feature (bumps MINOR version)”feat: add new swap validation functionfeat(api): improve error messagesFix (bumps PATCH version)
Section titled “Fix (bumps PATCH version)”fix: handle edge case in balance calculationfix(swaps): correct gas estimationDocumentation
Section titled “Documentation”docs: update API referencedocs: fix typo in READMEMaintenance
Section titled “Maintenance”chore: update dependencieschore: improve build configurationBreaking Changes (bumps MAJOR version)
Section titled “Breaking Changes (bumps MAJOR version)”feat!: remove deprecated APIfeat(api): change response format
BREAKING CHANGE: Response format changed from array to objectManual Release
Section titled “Manual Release”If you need to trigger a release manually:
- Go to Actions tab
- Select “Release” workflow
- Click “Run workflow”
- Select “main” branch
- Click “Run workflow”
Troubleshooting
Section titled “Troubleshooting”Tag Doesn’t Match package.json
Section titled “Tag Doesn’t Match package.json”Problem: GitHub created tag v0.1.2 but package.json says 0.1.1
Solution:
- Delete the incorrect tag:
Terminal window git tag -d v0.1.2git push origin :refs/tags/v0.1.2 - Update
package.jsonto correct version - Push to
mainagain
Release Not Created
Section titled “Release Not Created”Problem: Pushed to main but no release was created
Check:
- Go to Actions
- Find the “Release” workflow run
- Check logs for errors
- Verify
package.jsonversion changed from last tag
Changelog Missing Commits
Section titled “Changelog Missing Commits”Problem: Some commits don’t appear in the release notes
Solution: Ensure commits follow the conventional commit format
Version History
Section titled “Version History”| Version | Date | Changes |
|---|---|---|
| 0.1.0 | Initial release | Basic swap and balance functionality |