Skip to content

Commit

Permalink
Minor cleanup on the publish RubyGems action (#7337)
Browse files Browse the repository at this point in the history
Clarify that we're safe to run on every release.

Also clarify the expected scope of the API key so that if someone
rotates it, they remember to limit the scope of it.
  • Loading branch information
jeffwidman authored May 24, 2023
1 parent 8fee559 commit d097b11
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/gems-release-to-rubygems.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
name: Gems - Release to RubyGems
on:
release:
# It's fine to trigger on every release because if we tag a release w/o
# bumping the Gem version, RubyGems will reject it with an error that the
# version is already live.
types: [published]
permissions:
contents: read

jobs:
release-gems:
name: Release gems to rubygems.org
runs-on: ubuntu-latest

permissions:
contents: read

steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
- run: |
[ -d ~/.gem ] || mkdir ~/.gem
echo "---" > ~/.gem/credentials
echo ":rubygems_api_key: ${{ secrets.RUBYGEMS_API_KEY }}" > ~/.gem/credentials
echo ":rubygems_api_key: ${{ secrets.RUBYGEMS_API_KEY_WITH_SCOPE_LIMITED_TO_PUSH }}" > ~/.gem/credentials
chmod 0600 ~/.gem/credentials
gem install rake && rake gems:release

0 comments on commit d097b11

Please sign in to comment.