Semantic Versioning System¶
The Rive Playground uses an automated semantic versioning system that creates releases based on commit message flags. This prevents automatic versioning on every commit while providing controlled release management.
Overview¶
- No auto-versioning: Regular commits don't trigger version bumps
- Flag-based releases: Only commits with specific flags create new versions
- Automated workflow: GitHub Actions handles version bumping, changelog generation, and deployment
- Semantic versioning: Follows SemVer (MAJOR.MINOR.PATCH)
Version Types¶
| Type | When to Use | Examples |
|---|---|---|
| PATCH | Bug fixes, small improvements | fix: canvas clearing issue [patch] |
| MINOR | New features, non-breaking changes | feat: add new control panel [minor] |
| MAJOR | Breaking changes, major updates | feat!: redesign API structure [major] |
How to Create a Release¶
Method 1: Using the Helper Script (Recommended)¶
# Make the script executable (first time only)
chmod +x scripts/version.sh
# Create a patch release (bug fixes)
./scripts/version.sh patch "fix: canvas clearing issue"
# Create a minor release (new features)
./scripts/version.sh minor "feat: add asset manager panel"
# Create a major release (breaking changes)
./scripts/version.sh major "feat!: redesign control interface"
# Push to trigger the release
git push origin main
Method 2: Manual Commit with Flags¶
Add one of these flags to your commit message:
# Patch release
git commit -m "fix: resolve status bar layout issue [patch]"
# Minor release
git commit -m "feat: add semantic versioning system [minor]"
# Major release
git commit -m "feat!: breaking API changes [major]"
# Push to trigger
git push origin main
Method 3: GitHub Actions Manual Trigger¶
- Go to Actions tab in GitHub
- Select Semantic Release workflow
- Click Run workflow
- Choose version type (patch/minor/major)
- Click Run workflow
Supported Commit Flags¶
The system recognizes these patterns in commit messages:
Patch Flags¶
[patch]or[PATCH][fix]or[FIX]--patchor--fix
Minor Flags¶
[minor]or[MINOR]--minor
Major Flags¶
[major]or[MAJOR]--major
What Happens During a Release¶
When a versioned commit is pushed, the GitHub Action automatically:
- Detects the version flag in the commit message
- Bumps the version in
package.json - Generates changelog from commits since last release
- Creates version file (
src/version.js) with build info - Updates UI to display version number
- Commits changes with
[skip ci]flag - Creates Git tag (e.g.,
v1.2.3) - Creates GitHub Release with changelog and links
- Triggers deployment to GitHub Pages
Version Display¶
The current version is displayed in multiple places:
- Top-right corner of the app (small version badge)
- Browser console on app load
- GitHub Releases page
- CHANGELOG.md file
Package.json Scripts¶
Add these convenient scripts to your workflow:
# Quick version releases
npm run version:patch "fix: your bug fix message"
npm run version:minor "feat: your new feature"
npm run version:major "feat!: your breaking change"
# Check current version
npm run version:check
Best Practices¶
Commit Message Format¶
Follow Conventional Commits format:
<type>(<scope>): <description> [version-flag]
Examples:
fix(canvas): resolve clearing issue [patch]
feat(controls): add new panel layout [minor]
feat!(api): redesign parser interface [major]
When to Version¶
- PATCH: Bug fixes, typos, small improvements
- MINOR: New features, UI improvements, new components
- MAJOR: Breaking changes, major redesigns, API changes
Development Workflow¶
- Regular development: Commit normally without flags
- Ready for release: Use version script or add flag
- Push to main: Triggers automated release process
- Verify release: Check GitHub Releases page
Troubleshooting¶
Version Not Created¶
Check that your commit message contains a valid flag:
# ❌ Won't trigger version
git commit -m "fix canvas issue"
# ✅ Will trigger patch version
git commit -m "fix canvas issue [patch]"
Failed Release¶
- Check the Actions tab for error details
- Ensure you have proper permissions
- Verify the commit message format
- Check that
package.jsonexists and is valid
Manual Version Bump¶
If you need to manually set a version:
# Set specific version
npm version 2.1.0 --no-git-tag-version
# Commit with skip ci to avoid double-processing
git commit -m "chore: manual version bump to 2.1.0 [skip ci]"
Configuration¶
The versioning system is configured in:
.github/workflows/semantic-release.yml- Main workflowscripts/version.sh- Helper scriptpackage.json- Version storage
Customizing Version Patterns¶
To add new version trigger patterns, edit the workflow file:
# Add new patterns here
if echo "$COMMIT_MSG" | grep -qE "\[patch\]|\[PATCH\]|\[fix\]|\[FIX\]|--patch|--fix|\[hotfix\]"; then
Examples¶
Bug Fix Release (1.0.0 → 1.0.1)¶
Feature Release (1.0.1 → 1.1.0)¶
Breaking Change (1.1.0 → 2.0.0)¶
Integration with Deployment¶
The versioning system is integrated with the existing deployment workflow:
- Version created → Triggers semantic release
- Files updated → Version info added to app
- Release published → GitHub Release created
- Deployment triggered → App deployed with new version
This ensures that every release is properly versioned, documented, and deployed automatically.