Release Process¶
Overview¶
This document describes the release process for mitre-settingslogic gem.
Automated Release Process¶
Releases are automated via GitHub Actions when a tag is pushed.
Quick Release Commands¶
For patch releases (bug fixes):
For minor releases (new features):
For major releases (breaking changes):
These commands will: 1. Bump the version 2. Update CHANGELOG.md (via git-cliff if available) 3. Update Gemfile.lock 4. Run RuboCop with autocorrect 5. Run tests, linting, and security audit 6. Stage all changes for commit 7. Show you what will be committed 8. After you commit and push, create and push a git tag 9. Trigger automated gem publication
Manual Release Process¶
1. Update Version¶
Edit lib/settingslogic/version.rb
:
Or use rake tasks:
bundle exec rake version:patch # 3.0.0 -> 3.0.1
bundle exec rake version:minor # 3.0.0 -> 3.1.0
bundle exec rake version:major # 3.0.0 -> 4.0.0
2. Update CHANGELOG¶
Update CHANGELOG.md
with release notes:
## [3.0.1] - 2024-01-11
### Fixed
- Documentation updates
- License specification corrected to Apache-2.0
### Changed
- Renamed default branch from master to main
3. Run Tests¶
Ensure all tests pass:
4. Commit Changes¶
git add -A
git commit -m "Bump version to 3.0.1
Authored by: Aaron Lippold<lippold@gmail.com>"
git push origin main
5. Create Release Tag¶
Or manually:
6. GitHub Actions¶
The push of the tag triggers the .github/workflows/release.yml
workflow which:
1. Runs all tests
2. Creates a GitHub Release
3. Publishes the gem to RubyGems via OIDC
Release Checklist¶
Before releasing:
- [ ] All tests pass locally
- [ ] RuboCop shows no violations
- [ ] Security audit passes (
bundle exec rake audit
) - [ ] CHANGELOG.md is updated
- [ ] Version number is bumped appropriately
- [ ] Documentation is up to date
- [ ] CI/CD pipeline is green
Version Numbering¶
We follow Semantic Versioning:
- MAJOR version (X.0.0) - Incompatible API changes
- MINOR version (0.X.0) - Backwards-compatible functionality additions
- PATCH version (0.0.X) - Backwards-compatible bug fixes
Examples:¶
- Security fix that changes behavior: MAJOR
- Adding new configuration options: MINOR
- Fixing a bug: PATCH
- Documentation updates: PATCH
OIDC Trusted Publishing¶
This gem uses OIDC trusted publishing for secure, token-less releases to RubyGems.
Setup (Already Complete)¶
- Gem is registered on RubyGems as
mitre-settingslogic
- OIDC trusted publisher configured for
mitre/settingslogic
repository - GitHub Actions workflow uses
rubygems/configure-rubygems-credentials@v1.0.0
How It Works¶
- Push a tag starting with
v
(e.g.,v3.0.1
) - GitHub Actions workflow runs
- OIDC token is exchanged for temporary RubyGems credentials
- Gem is built and pushed automatically
No API keys or secrets are stored in the repository.
Troubleshooting¶
Release Workflow Fails¶
- Check GitHub Actions logs
- Ensure tag format is correct (
v
prefix) - Verify OIDC publisher configuration on RubyGems
Gem Push Permission Denied¶
- Ensure you're listed as an owner on RubyGems
- Check that gem name matches:
mitre-settingslogic
Tests Fail on Release¶
- Fix the failing tests
- Delete the tag:
git tag -d v3.0.1 && git push origin :v3.0.1
- Start the release process again
Post-Release¶
After a successful release:
- Verify gem on RubyGems: https://rubygems.org/gems/mitre-settingslogic
- Test installation:
gem install mitre-settingslogic
- Update any dependent projects
- Announce release if it contains important changes
Emergency Yank¶
If a broken version is released:
Then release a fixed version immediately.