--- name: Pipeline on: - push concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: build: name: Build runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 with: ref: ${{ github.event.pull_request.head.sha }} - uses: ruby/setup-ruby@v1 with: bundler-cache: true - name: Fetch main branch run: git fetch origin main - uses: r7kamura/rubocop-problem-matchers-action@v1 - name: Lint run: | bundle exec rubocop bundle exec bundle-audit update bundle exec bundle-audit check - name: Run rspec run: bundle exec rspec - name: Release the gem if: ${{ github.ref == 'refs/heads/main' }} run: | mkdir -p ~/.gem cat << EOF > ~/.gem/credentials --- :github: Bearer ${GITHUB_TOKEN} :rubygems_api_key: ${RUBYGEMS_API_KEY} EOF chmod 0600 ~/.gem/credentials git config user.email "noreply@wealthsimple.com" git config user.name "Wolfbot" bundle exec rake release env: RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}