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