Release #14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| name: Release | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: "Release version (e.g., 1.12.0)" | |
| required: true | |
| type: string | |
| jobs: | |
| release: | |
| name: Release v${{ github.event.inputs.version }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: ./.github/actions/setup-ruby-and-dependencies | |
| with: | |
| ruby-version: "4.0" | |
| cache-apt-packages: true | |
| - name: Verify version | |
| run: | | |
| GEM_VERSION="${{ github.event.inputs.version }}" | |
| CODE_VERSION=$(ruby -I lib -r capybara/screenshot/diff/version -e "puts Capybara::Screenshot::Diff::VERSION") | |
| if [ "$GEM_VERSION" != "$CODE_VERSION" ]; then | |
| echo "Version mismatch: input=$GEM_VERSION code=$CODE_VERSION" | |
| exit 1 | |
| fi | |
| - name: Test | |
| run: bundle exec rake test:unit | |
| - name: Create tag | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git tag -a "v${{ github.event.inputs.version }}" -m "v${{ github.event.inputs.version }}" | |
| git push origin "v${{ github.event.inputs.version }}" | |
| - name: Publish to RubyGems | |
| uses: rubygems/release-gem@v1 | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: "v${{ github.event.inputs.version }}" | |
| name: "v${{ github.event.inputs.version }}" | |
| body: | | |
| ## What's Changed | |
| See [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/main/CHANGELOG.md#v${{ github.event.inputs.version }}) for full details. | |
| **Upgrade Guide:** [docs/UPGRADING.md](https://github.com/${{ github.repository }}/blob/main/docs/UPGRADING.md) | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |