Push to Rubygems #90
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: Push to Rubygems | |
| 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.2" | |
| 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') | |
| env: | |
| SIGNING_KEY_PEM: ${{ secrets.PRIVATE_KEY_PEM }} | |
| run: | | |
| gem_conf="$HOME/.gem" | |
| mkdir -p "$gem_conf" | |
| install -m 600 /dev/null "$gem_conf/credentials" | |
| printf ":rubygems_api_key: ${{ secrets.RUBYGEMS_API_KEY }}\n" > "$gem_conf"/credentials | |
| rake release_signed |