Sha256: 2be5f6622cc79c21dec3283571b480567c2ab7cbcde64258c8a320dae7d58878

Contents?: true

Size: 1.48 KB

Versions: 2

Compression:

Stored size: 1.48 KB

Contents

name: Release

on:
  push:
    branches: [ master ]

jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        ruby-version: [ '3.0', '3.2', 'jruby' ]

    steps:
      - uses: actions/checkout@v4
      - name: Set up Ruby
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: ${{ matrix.ruby-version }}
          bundler-cache: false # runs 'bundle install' and caches installed gems automatically
      - name: Install gems
        run: bundle install
      - name: Run tests
        run: bundle exec rspec

  tag:
    needs: test
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4

      - name: Tag automatically
        run: git tag v`cat lib/opera/version.rb | grep 'VERSION' | awk '{ print $3 $4 }' | sed "s/'//g"`

      - name: Push tags
        run: git push origin --tags

  publish:
    needs: tag
    name: Build + Publish
    runs-on: ubuntu-latest
    permissions:
      contents: read
      packages: write

    steps:
      - uses: actions/checkout@v4
      - name: Set up Ruby 3.2
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: 3.2

      - name: Publish to RubyGems
        run: |
          mkdir -p $HOME/.gem
          touch $HOME/.gem/credentials
          chmod 0600 $HOME/.gem/credentials
          printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
          gem build *.gemspec
          gem push *.gem
        env:
          GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
opera-0.3.1 .github/workflows/release.yml
opera-0.3.0 .github/workflows/release.yml