From 973822bd3bf4beab5d43eaa11491ae5a31f618d7 Mon Sep 17 00:00:00 2001 From: Myron Marston Date: Fri, 6 Dec 2024 20:33:29 -0800 Subject: [PATCH] Rename `push_gem.yaml` to `release.yaml` and update dependent actions. I think "release" is a more natural name for this workflow as it cuts a release. (I don't usually here people refer to that as "pushing a gem"). In addition, I've updated all dependent actions to the latest versions to try to fix a failure I just got on my last attempt at running it: ``` Run ruby/setup-ruby@cacc9f1c0b3f4eb8a16a6bb0ed10897b43b9de49 with: working-directory: config/release bundler-cache: true ruby-version: ruby Error: The current runner (ubuntu-24.04-x64) was detected as self-hosted because the platform does not match a GitHub-hosted runner image (or that image is deprecated and no longer supported). In such a case, you should install Ruby in the $RUNNER_TOOL_CACHE yourself, for example using https://github.com/rbenv/ruby-build You can take inspiration from this workflow for more details: https://github.com/ruby/ruby-builder/blob/master/.github/workflows/build.yml $ ruby-build 3.3.1 /opt/hostedtoolcache/Ruby/3.3.1/x64 Once that completes successfully, mark it as complete with: $ touch /opt/hostedtoolcache/Ruby/3.3.1/x64.complete It is your responsibility to ensure installing Ruby like that is not done in parallel. ``` As per https://github.com/ruby/setup-ruby/issues/595, it appears that updating the version of this action will fix the error. While I'm at it I went ahead and updated the others, too. --- .github/workflows/{push_gem.yaml => release.yaml} | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) rename .github/workflows/{push_gem.yaml => release.yaml} (85%) diff --git a/.github/workflows/push_gem.yaml b/.github/workflows/release.yaml similarity index 85% rename from .github/workflows/push_gem.yaml rename to .github/workflows/release.yaml index 0924b72f..2043ff0f 100644 --- a/.github/workflows/push_gem.yaml +++ b/.github/workflows/release.yaml @@ -1,5 +1,5 @@ # This workflow was generated by https://github.com/rubygems/configure_trusted_publisher -name: Push Gem +name: Release on: workflow_dispatch: @@ -35,13 +35,15 @@ jobs: steps: # Set up - name: Harden Runner - uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 + uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 with: egress-policy: audit - - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + - name: Checkout Git Repo + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - name: Set up Ruby - uses: ruby/setup-ruby@cacc9f1c0b3f4eb8a16a6bb0ed10897b43b9de49 # v1.176.0 + uses: ruby/setup-ruby@2a18b06812b0e15bb916e1df298d3e740422c47e # v1.203.0 with: working-directory: config/release bundler-cache: true @@ -72,7 +74,7 @@ jobs: # Release - name: Release to rubygems.org - uses: rubygems/release-gem@612653d273a73bdae1df8453e090060bb4db5f31 # v1 + uses: rubygems/release-gem@9e85cb11501bebc2ae661c1500176316d3987059 # v1.1.0 with: await-release: ${{ ! inputs.dry-run }} @@ -84,7 +86,7 @@ jobs: branch: release-v${{ inputs.version }} title: "Release v${{ inputs.version }}" body: | - - [ ] Confirm the [push-gem action](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) succeeded before merging + - [ ] Confirm the [release action](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) succeeded before merging - [ ] Confirm this version bump should be merged into [${{ github.ref_name }}](https://github.com/${{ github.repository }}/tree/${{ github.ref_name }}) or change the base branch - [ ] Review and edit the [GitHub Draft Release](https://github.com/${{ github.repository }}/releases) (can be done after this PR is merged)