Skip to content

Commit

Permalink
Use OIDC Trusted Publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
CGA1123 committed Apr 7, 2024
1 parent 0778dc7 commit 4519877
Showing 1 changed file with 5 additions and 18 deletions.
23 changes: 5 additions & 18 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,17 @@ name: Release

on:
workflow_dispatch:
inputs:
otp:
name: 'RubyGems OTP Code'
required: true

jobs:
release:
permissions:
contents: write
id-token: write

name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
- name: Mask OTP
run: |
OTP=$(jq -r '.inputs.otp' $GITHUB_EVENT_PATH)
echo "::add-mask::$OTP"
- run: gem update --system
- run: git config --global user.email github-action@users.noreply.github.com
- run: git config --global user.name GitHub Actions
- run: git config --global user.password ${{ github.token }}
- run: bundle install
- run: bundle exec rake release
env:
GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
GEM_HOST_OTP_CODE: ${{ github.event.inputs.otp }}
- uses: rubygems/release-gem@v1

0 comments on commit 4519877

Please sign in to comment.