diff --git a/.github/workflows/create-gem-bump-branch.yml b/.github/workflows/create-gem-bump-branch.yml new file mode 100644 index 0000000..e1108bd --- /dev/null +++ b/.github/workflows/create-gem-bump-branch.yml @@ -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'