name: ci on: push: jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Set up Ruby uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108 - name: Install dependencies run: bundle install - name: Run tests run: rspec . deploy: name: Build and publish gem if: github.ref == 'refs/heads/main' && needs.test.result == 'success' needs: test runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Set up Ruby uses: ruby/setup-ruby@477b21f02be01bcb8030d50f37cfec92bfa615b6 - name: Publish to GPR run: | curl -u $RUBYGEMS_USERNAME:$RUBYGEMS_PASSWORD https://rubygems.org/api/v1/api_key.yaml > ~/.gem/credentials; chmod 0600 ~/.gem/credentials gem build arxiv.gemspec gem push `ls | grep *.gem` env: RUBYGEMS_USERNAME: "${{ secrets.RUBYGEMS_USERNAME }}" RUBYGEMS_PASSWORD: "${{ secrets.RUBYGEMS_PASSWORD }}"