Skip to content

Commit

Permalink
ci: use rubygems/release-gem to publish gem
Browse files Browse the repository at this point in the history
temporarily remove publishing to GH packages
  • Loading branch information
rafasoares committed Oct 29, 2024
1 parent 9e52eaf commit 45a1308
Showing 1 changed file with 7 additions and 27 deletions.
34 changes: 7 additions & 27 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ on:
release:
types: [published]

permissions:
packages: write
contents: read

jobs:
tests:
uses: ./.github/workflows/tests.yml
Expand All @@ -18,6 +14,12 @@ jobs:

needs: tests

permissions:
packages: write
contents: read
attestations: write
id-token: write

steps:
- uses: actions/checkout@v4

Expand All @@ -26,26 +28,4 @@ jobs:
rubygems: latest
bundler-cache: true

- name: Create credentials file
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 600 $HOME/.gem/credentials
echo ":github: Bearer ${GITHUB_TOKEN}" >> ~/.gem/credentials
echo ":rubygems_api_key: Bearer ${RUBYGEMS_AUTH_TOKEN}" > ~/.gem/credentials
- name: Build gem
run: gem build *.gemspec

- name: Publish to Github Packages
run: |
gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
OWNER: rafasoares

- name: Publish to RubyGems
run: |
gem push *.gem
env:
RUBYGEMS_AUTH_TOKEN: ${{secrets.RUBYGEMS_AUTH_TOKEN}}
- uses: rubygems/release-gem@v1

0 comments on commit 45a1308

Please sign in to comment.