name: test-and-release on: push: branches: [ main ] tags: [ 'v*' ] pull_request: concurrency: group: '${{ github.workflow }}-${{ github.job }}-${{ github.head_ref || github.ref_name }}' cancel-in-progress: true jobs: test: name: Test on Ruby ${{ matrix.ruby }} ${{ matrix.os }} runs-on: ${{ matrix.os }} continue-on-error: false strategy: fail-fast: false matrix: ruby: [ '2.5', '2.6', '2.7', '3.0', '3.1' ] os: [ ubuntu-latest, windows-latest, macos-latest ] steps: - uses: actions/checkout@v3 - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} bundler-cache: true - run: bundle exec rspec release: name: Release gem needs: test runs-on: ubuntu-latest if: contains(github.ref, 'refs/tags/v') steps: - uses: actions/checkout@v3 - uses: ruby/setup-ruby@v1 with: ruby-version: 2.7 bundler-cache: true - uses: cadwallion/publish-rubygems-action@master env: RUBYGEMS_API_KEY: ${{secrets.RIBOSE_RUBYGEMS_API_KEY}}