Release a New Version #5
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
name: Release a New Version | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: "New Version. major|minor|patch|rc or an explicit version number." | |
required: true | |
default: patch | |
type: string | |
permissions: | |
contents: write | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref_name }} | |
cancel-in-progress: true | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
id-token: write | |
outputs: | |
new_version: ${{ steps.bump_version.outputs.new_version }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: git-actions/set-user@v1 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.2 | |
bundler-cache: true | |
rubygems: latest | |
- name: Bump version | |
id: bump_version | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
bundle config unset deployment | |
bundle exec gem bump -v ${{ inputs.version }} -m "v%{version}" | |
bundle install | |
git add Gemfile.lock Gemfile.ruby-2.6.lock | |
git commit --amend --no-edit | |
- uses: rubygems/release-gem@v1 |