Push to Rubygems #80
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Action to push a gem version to RubyGems when a new tag is created | |
| name: Deploy | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| jobs: | |
| build: | |
| name: Build + Publish | |
| runs-on: ubuntu-latest | |
| env: | |
| BUNDLE_WITHOUT: optional:development:special | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: "4.0.1" | |
| bundler-cache: true # runs 'bundle install' and caches installed gems automatically | |
| - name: Install rake | |
| run: gem install rake | |
| - name: Publish to RubyGems | |
| if: contains(github.ref, 'refs/tags/v') | |
| run: | | |
| mkdir -p $HOME/.gem | |
| export SIGNING_KEY=$HOME/.gem/signing_key.pem | |
| GEM_CREDS=$HOME/.gem/credentials | |
| echo "${{ secrets.PRIVATE_KEY_PEM }}" > $SIGNING_KEY | |
| echo ":rubygems_api_key: ${{ secrets.RUBYGEMS_API_KEY }}" > $GEM_CREDS | |
| chmod 0600 $SIGNING_KEY $GEM_CREDS | |
| rake release_signed |