v1.0.5 #6
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: Publish to RubyGems | |
| on: | |
| workflow_dispatch: | |
| push: | |
| tags: | |
| - v* | |
| pull_request: | |
| branches: [main, master] | |
| jobs: | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: "2.6" | |
| bundler-cache: true | |
| - name: Run tests | |
| run: bundle exec rspec spec --format progress | |
| publish: | |
| name: Build & Publish gem | |
| needs: test | |
| if: github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/') | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| environment: release | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: "2.6" | |
| bundler-cache: true | |
| - name: Build gem | |
| run: gem build lara-sdk.gemspec | |
| - name: Configure RubyGems credentials (OIDC) | |
| uses: rubygems/configure-rubygems-credentials@v1.0.0 | |
| - name: Publish gem | |
| run: gem push lara-sdk-*.gem |