Repository navigation
fix: add configurable keep-alive and Faraday adapter options #110
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 | |
| on: | |
| pull_request: | |
| types: [closed] | |
| branches: | |
| - main | |
| - master | |
| concurrency: | |
| group: release-${{ github.event.pull_request.base.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| name: 🚀 Release | |
| if: github.event.pull_request.merged == true | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ github.event.pull_request.base.ref }} | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: "3.1.0" | |
| - name: Install dependencies | |
| run: bundle install --jobs 4 --retry 3 | |
| - name: Skip when PR is already released | |
| id: already_released | |
| run: | | |
| if git log --oneline --grep="(pr #${{ github.event.pull_request.number }})" -n 1 | grep -q "chore(release):"; then | |
| echo "value=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "value=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Determine and apply version bump | |
| id: release_meta | |
| if: steps.already_released.outputs.value != 'true' | |
| env: | |
| PR_TITLE: ${{ github.event.pull_request.title }} | |
| PR_BODY: ${{ github.event.pull_request.body }} | |
| run: | | |
| PR_BODY_FILE=$(mktemp) | |
| printf '%s' "$PR_BODY" > "$PR_BODY_FILE" | |
| ruby scripts/release/bump_version.rb \ | |
| --title "$PR_TITLE" \ | |
| --body-file "$PR_BODY_FILE" \ | |
| --output "$GITHUB_OUTPUT" | |
| - name: Stop when PR does not require release | |
| if: steps.already_released.outputs.value == 'true' || steps.release_meta.outputs.should_release != 'true' | |
| run: | | |
| if [ "${{ steps.already_released.outputs.value }}" = "true" ]; then | |
| echo "PR #${{ github.event.pull_request.number }} is already released; skipping." | |
| exit 0 | |
| fi | |
| echo "No release type found in PR title; skipping." | |
| exit 0 | |
| - name: Commit version files | |
| if: steps.already_released.outputs.value != 'true' && steps.release_meta.outputs.should_release == 'true' | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add lib/getstream_ruby/version.rb | |
| if git diff --cached --quiet; then | |
| echo "No version changes to commit." | |
| exit 0 | |
| fi | |
| git commit -m "chore(release): v${{ steps.release_meta.outputs.version }} (pr #${{ github.event.pull_request.number }})" | |
| git push origin "HEAD:${{ github.event.pull_request.base.ref }}" | |
| - name: Create release tag | |
| if: steps.already_released.outputs.value != 'true' && steps.release_meta.outputs.should_release == 'true' | |
| run: | | |
| git tag "${{ steps.release_meta.outputs.tag }}" | |
| git push origin "${{ steps.release_meta.outputs.tag }}" | |
| - name: Build and publish gem | |
| if: steps.already_released.outputs.value != 'true' && steps.release_meta.outputs.should_release == 'true' | |
| env: | |
| GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }} | |
| run: | | |
| gem build getstream-ruby.gemspec | |
| gem push getstream-ruby-${{ steps.release_meta.outputs.version }}.gem --key "$GEM_HOST_API_KEY" | |
| - name: Create release on GitHub | |
| if: steps.already_released.outputs.value != 'true' && steps.release_meta.outputs.should_release == 'true' | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| tag: ${{ steps.release_meta.outputs.tag }} | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| body: | | |
| Release v${{ steps.release_meta.outputs.version }} | |
| - Bump type: `${{ steps.release_meta.outputs.bump }}` | |
| - Previous: `${{ steps.release_meta.outputs.previous_version }}` | |
| - Next: `${{ steps.release_meta.outputs.version }}` |