Skip to content

Releasing

This guide explains the release process for the Cooperative SDK.

When code is pushed to the main branch, GitHub Actions automatically:

  1. Reads the version from package.json
  2. Checks if it changed from the last release
  3. Builds the package
  4. Generates a changelog from commit messages
  5. Creates a GitHub release with the tag vX.Y.Z

Use the version bump script:

Terminal window
# Bump version based on commits
pnpm run version:bump
# See what would happen first
pnpm run version:dry-run

The 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)
{
"version": "0.1.1" // Set manually if needed
}
Terminal window
# Ensure you're on develop branch
git checkout develop
# Update with latest changes
git pull origin develop
# Merge to main
git checkout main
git merge develop
git push origin main

Check the GitHub Releases page:

  • ✅ Tag matches package.json version (e.g., v0.1.1)
  • ✅ Changelog is accurate
  • ✅ Release is published

Use conventional commits for automatic changelog generation:

feat: add new swap validation function
feat(api): improve error messages
fix: handle edge case in balance calculation
fix(swaps): correct gas estimation
docs: update API reference
docs: fix typo in README
chore: update dependencies
chore: improve build configuration
feat!: remove deprecated API
feat(api): change response format
BREAKING CHANGE: Response format changed from array to object

If you need to trigger a release manually:

  1. Go to Actions tab
  2. Select “Release” workflow
  3. Click “Run workflow”
  4. Select “main” branch
  5. Click “Run workflow”

Problem: GitHub created tag v0.1.2 but package.json says 0.1.1

Solution:

  1. Delete the incorrect tag:
    Terminal window
    git tag -d v0.1.2
    git push origin :refs/tags/v0.1.2
  2. Update package.json to correct version
  3. Push to main again

Problem: Pushed to main but no release was created

Check:

  1. Go to Actions
  2. Find the “Release” workflow run
  3. Check logs for errors
  4. Verify package.json version changed from last tag

Problem: Some commits don’t appear in the release notes

Solution: Ensure commits follow the conventional commit format

VersionDateChanges
0.1.0Initial releaseBasic swap and balance functionality