From 45a13087a59e0ca7570a61447648465c7447a227 Mon Sep 17 00:00:00 2001 From: Rafael Soares <893971+rafasoares@users.noreply.github.com> Date: Tue, 29 Oct 2024 14:41:27 +0100 Subject: [PATCH] ci: use rubygems/release-gem to publish gem temporarily remove publishing to GH packages --- .github/workflows/publish.yml | 34 +++++++--------------------------- 1 file changed, 7 insertions(+), 27 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 91eb9a7..a7f74ff 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -4,10 +4,6 @@ on: release: types: [published] -permissions: - packages: write - contents: read - jobs: tests: uses: ./.github/workflows/tests.yml @@ -18,6 +14,12 @@ jobs: needs: tests + permissions: + packages: write + contents: read + attestations: write + id-token: write + steps: - uses: actions/checkout@v4 @@ -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