-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add manually dispatched workflow for creating a gem bump
- Loading branch information
Showing
1 changed file
with
43 additions
and
0 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 |
---|---|---|
@@ -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' |