Release 0.5.0.rc4 #17
Workflow file for this run
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 gem | |
| on: | |
| push: | |
| tags: | |
| - '*' | |
| permissions: | |
| contents: read | |
| jobs: | |
| push: | |
| if: github.repository == 'eval/bonchi' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| id-token: write | |
| attestations: write | |
| steps: | |
| # Set up | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0 | |
| with: | |
| egress-policy: audit | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@2e007403fc1ec238429ecaa57af6f22f019cc135 # v1.234.0 | |
| with: | |
| bundler-cache: true | |
| ruby-version: ruby | |
| # Read version from version.rb | |
| - name: Get version | |
| id: version | |
| run: | | |
| version=$(ruby -r ./lib/bonchi/version -e 'puts Bonchi::VERSION') | |
| echo "version=$version" >> "$GITHUB_OUTPUT" | |
| # Release | |
| - uses: rubygems/release-gem@1c162a739e8b4cb21a676e97b087e8268d8fc40b # v1.1.2 | |
| # Job Summary | |
| - name: Summary | |
| run: | | |
| version="${{ steps.version.outputs.version }}" | |
| cat >> "$GITHUB_STEP_SUMMARY" <<EOF | |
| ## 🌳 Bonchi ${version} | |
| - **RubyGems**: https://rubygems.org/gems/bonchi/versions/${version} | |
| - **Changelog**: https://github.com/eval/bonchi/blob/main/CHANGELOG.md#${version//./} | |
| - **Attestation**: `gem fetch bonchi -v ${version} && gh attestation verify bonchi-${version}.gem --owner eval` | |
| EOF | |
| # GH Attestations | |
| - uses: actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32 # v4.1.0 | |
| with: | |
| subject-path: pkg/*.gem | |
| # GH Release | |
| - name: Create GitHub release | |
| run: | | |
| version="${{ steps.version.outputs.version }}" | |
| dot_count=$(echo "$version" | tr -cd '.' | wc -c) | |
| read -r -d '' notes <<EOF || true | |
| ## ✨ Bonchi ${version} 🌳 | |
| A git worktree manager. | |
| **Rubygems**: https://rubygems.org/gems/bonchi/versions/${version} | |
| **Changelog**: https://github.com/eval/bonchi/blob/main/CHANGELOG.md#${version//./} | |
| EOF | |
| if [[ "$dot_count" -gt 2 ]]; then | |
| gh release create "$version" --prerelease --generate-notes | |
| else | |
| gh release create "$version" --generate-notes --notes "$notes" | |
| fi | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} |