Skip to content

Commit

Permalink
Add manually dispatched workflow for creating a gem bump
Browse files Browse the repository at this point in the history
  • Loading branch information
singhprd committed Aug 21, 2023
1 parent ff413d6 commit 0e8eaa9
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/create-gem-bump-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Create Gem Bump Branch
on:
workflow_dispatch:
inputs:
new-gem-version:
type: choice
options:
- major
- minor
- patch
- pre
- release
required: true

jobs:
release:
name: Bump Gem / Create PR
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write

steps:
- uses: actions/checkout@v3

- uses: ruby/setup-ruby@v1
with:
bundler-cache: true

- run: |
bundle exec gem bump --version ${{ github.event.inputs.new-gem-version || 'patch' }} --no-commit
NEW_VERSION=$(ruby -r ./lib/serverless-tools/version.rb -e "puts ServerlessTools::VERSION")
bundle config unset deployment
bundle install
ruby -pi.bak -e "gsub(/serverless-tools-gha\:.*\"/, 'serverless-tools-gha:v$NEW_VERSION\"')" action.yml
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Gem bump $NEW_VERSION - ${{ github.actor }}
file_pattern: 'action.yml Gemfile.lock lib/serverless-tools/version.rb'
branch: ${{ github.event.inputs.new-gem-version }}-${{ github.actor }}
create_branch: false
push_options: '--force'

0 comments on commit 0e8eaa9

Please sign in to comment.