-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
22 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
@@ -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 |