Skip to content

Commit

Permalink
Update publish gem action
Browse files Browse the repository at this point in the history
  • Loading branch information
excid3 committed Apr 25, 2024
1 parent 6c40029 commit f255913
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions .github/workflows/publish_gem.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 [email protected]
git add Gemfile.lock gemfiles lib
git commit -m "Version bump"
git push
# Release
- uses: rubygems/release-gem@v1

0 comments on commit f255913

Please sign in to comment.