From f2559138a364d684cf816dfc40c9226a4abde308 Mon Sep 17 00:00:00 2001 From: Chris Oliver Date: Wed, 24 Apr 2024 20:31:12 -0500 Subject: [PATCH] Update publish gem action --- .github/workflows/publish_gem.yml | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish_gem.yml b/.github/workflows/publish_gem.yml index 8d4fda7..cfc6e24 100644 --- a/.github/workflows/publish_gem.yml +++ b/.github/workflows/publish_gem.yml @@ -1,14 +1,19 @@ -name: Publish gem -on: workflow_dispatch +name: Publish Gem +on: + workflow_dispatch: + inputs: + version: + description: "Version" + required: true + type: string jobs: push: - name: Publish gem to RubyGems.org runs-on: ubuntu-latest permissions: - id-token: write # IMPORTANT: this permission is mandatory for trusted publishing - contents: write # IMPORTANT: this permission is required for `rake release` to push the release tag + contents: write + id-token: write steps: # Set up @@ -19,5 +24,17 @@ jobs: bundler-cache: true ruby-version: ruby + - name: Update version + run: | + sed -i 's/".*"/"${{ inputs.version }}"/' lib/prefixed_ids/version.rb + bundle config set frozen false + bundle + bundle exec appraisal + git config user.name 'GitHub Actions' + git config user.email github-actions@github.com + git add Gemfile.lock gemfiles lib + git commit -m "Version bump" + git push + # Release - uses: rubygems/release-gem@v1