chore: add .env.local to gitignore and bump gem version to 0.6.0 #13
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: ruby-client | |
| on: | |
| push: | |
| branches: [main, feat/bootstrap] | |
| # Note: GitHub ignores `paths` filters on tag pushes, so both jobs | |
| # will always fire on a version tag — which is the desired behaviour. | |
| tags: ["v*.*.*"] | |
| paths: | |
| - "clients/ruby/beacon-client/**" | |
| - "spec/fixtures.json" | |
| - ".github/workflows/ruby-client.yml" | |
| pull_request: | |
| paths: | |
| - "clients/ruby/beacon-client/**" | |
| - "spec/fixtures.json" | |
| - ".github/workflows/ruby-client.yml" | |
| jobs: | |
| test-and-bench: | |
| name: minitest + Rack overhead bench | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: clients/ruby/beacon-client | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: "3.4" | |
| bundler-cache: false | |
| - name: Install minimal deps | |
| run: gem install 'minitest:~> 5.20' rack --no-document | |
| - name: Run unit tests | |
| run: rake test | |
| - name: Run Rack overhead bench (fails if added P95 > 50µs) | |
| run: rake bench | |
| publish: | |
| name: Publish to RubyGems | |
| needs: test-and-bench | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: clients/ruby/beacon-client | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: "3.4" | |
| - name: Verify version.rb matches tag | |
| run: | | |
| TAG_VERSION="${GITHUB_REF#refs/tags/v}" | |
| FILE_VERSION=$(ruby -e "require_relative 'lib/beacon/version'; puts Beacon::VERSION") | |
| if [ "$TAG_VERSION" != "$FILE_VERSION" ]; then | |
| echo "::error::version.rb ($FILE_VERSION) doesn't match tag ($TAG_VERSION)" | |
| exit 1 | |
| fi | |
| - name: Resolve version from tag | |
| id: version | |
| run: echo "value=${GITHUB_REF#refs/tags/v}" >> "$GITHUB_OUTPUT" | |
| - name: Build gem | |
| run: gem build beacon-client.gemspec | |
| env: | |
| BEACON_VERSION: ${{ steps.version.outputs.value }} | |
| - name: Smoke test | |
| run: gem install beacon-client-*.gem | |
| - name: Publish gem | |
| run: gem push beacon-client-*.gem | |
| env: | |
| GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }} |