This repository includes several GitHub Actions workflows to automate the development and release process for your Ruby gem.
- Triggers: Push to main/develop branches, pull requests to main
- Features:
- Tests on Ruby 2.7, 3.0, 3.1, 3.2
- RuboCop code style checks
- Code coverage analysis
- Gem building and artifact upload
- OpenSpec change detection
- Triggers: Git tags starting with
v* - Features:
- Automatic GitHub Release creation
- Changelog generation from git commits
- Gem artifact upload to release
- RubyGems publishing
- Triggers:
- Changes to
openspec/directory - Manual workflow dispatch
- Changes to
- Features:
- Automatic detection of completed OpenSpec phases
- Phase-based tagging (e.g.,
feature-name-v1.2.3) - GitHub release creation for phase completion
- Manual phase tagging option
- Triggers: Manual workflow dispatch or called from other workflows
- Features:
- RubyGems version checking
- Safe publishing (skips if version exists)
- GitHub release creation
- Gem building and validation
To use these workflows, add the following secrets to your GitHub repository:
- GITHUB_TOKEN: Automatically provided by GitHub Actions
- RUBYGEMS_API_KEY: Your RubyGems API key for publishing gems
- Complete your development work
- Create and push a version tag:
git tag v1.0.0 git push origin v1.0.0 - The release workflow will automatically:
- Run all tests
- Build the gem
- Create a GitHub release
- Publish to RubyGems
- Create OpenSpec changes in the
openspec/changes/directory - Complete all tasks in your change
- Push to main branch
- The OpenSpec Phase Tagging workflow will:
- Detect completed changes
- Create phase-specific tags
- Create GitHub releases for each phase
- Go to Actions tab in GitHub
- Select "OpenSpec Phase Tagging" workflow
- Click "Run workflow"
- Enter phase name and optional version
- The workflow will create a tag and release for your phase
- Go to Actions tab in GitHub
- Select "Publish Gem" workflow
- Click "Run workflow"
- The workflow will build and publish your gem if the version doesn't exist
- Version tags:
v1.2.3(triggers full release) - Phase tags:
feature-name-v1.2.3(triggers phase release) - Manual tags: Use workflow dispatch for custom naming
The workflows are designed to work seamlessly with OpenSpec:
- Phase Detection: Automatically detects when all tasks in a change are complete
- Change Documentation: Includes OpenSpec proposal and task information in releases
- Archive Integration: Works with the OpenSpec archive-change skill
To test workflows locally, you can use act (GitHub Actions runner):
# Install act
curl https://raw.githubusercontent.com/nektos/act/master/install.sh | sudo bash
# Run workflow
act -j test
- RubyGems Publishing: Ensure your
RUBYGEMS_API_KEYis correct and has publish permissions - Tag Conflicts: Make sure tag names are unique and follow the semver pattern
- OpenSpec Detection: Ensure changes are in the correct directory with completed tasks