on: release: types: [released] jobs: test: env: TELNYX_MOCK_VERSION: 0.8.13 runs-on: ubuntu-latest strategy: matrix: ruby: [ '2.5', '2.6', '2.7', '3.0' ] steps: - uses: actions/checkout@v2 - name: Set up Ruby # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby, # change this to (see https://github.com/ruby/setup-ruby#versioning): # uses: ruby/setup-ruby@v1 uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} - name: Run Setup Script to install mock run: source ./.github/scripts/before_install.sh shell: bash - name: Install dependencies run: bundle install - name: Run tests run: bundle exec rake build_and_publish_gem: name: Build + Publish Gem needs: test runs-on: ubuntu-latest permissions: packages: write contents: read steps: - uses: actions/checkout@v2 - name: Set up Ruby 2.6 uses: ruby/setup-ruby@477b21f02be01bcb8030d50f37cfec92bfa615b6 with: ruby-version: 2.6 - run: bundle install - 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_API_KEY}}"