Merge pull request #117 from braintrustdata/bump_version_0.2.1 #20
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
| # | |
| # This workflow publishes the Ruby SDK to RubyGems when a release tag is pushed. | |
| # It validates the tag, ensures the commit is on main, runs tests, and publishes. | |
| # | |
| name: Publish Ruby SDK | |
| on: | |
| push: | |
| tags: | |
| - 'v*.*.*' | |
| jobs: | |
| validate: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| release_tag: ${{ steps.get-tag.outputs.tag }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Get release tag | |
| id: get-tag | |
| run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.4' | |
| bundler-cache: true | |
| - name: Validate release tag | |
| run: bash scripts/validate-release-tag.sh | |
| publish: | |
| needs: validate | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.4' | |
| bundler-cache: true | |
| - name: Configure RubyGems credentials | |
| uses: rubygems/configure-rubygems-credentials@main | |
| - name: Release | |
| run: bundle exec rake release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |