Create release PR #9
Workflow file for this run
This file contains hidden or 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: Create release PR | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: "The new version number. Example: 1.40.1" | |
| required: true | |
| type: string | |
| pattern: "^[0-9]+\\.[0-9]+\\.[0-9]+$" | |
| jobs: | |
| init_release: | |
| name: 🚀 Create release PR | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 # gives the changelog generator access to all previous commits | |
| - name: Update CHANGELOG.md, build.gradle and push release branch | |
| env: | |
| VERSION: ${{ github.event.inputs.version }} | |
| run: | | |
| npx --yes [email protected] --release-as "$VERSION" --skip.tag --skip.commit --tag-prefix= | |
| echo "version=$VERSION" > gradle.properties | |
| git config --global user.name 'github-actions' | |
| git config --global user.email '[email protected]' | |
| git checkout -q -b "release-$VERSION" | |
| git add CHANGELOG.md gradle.properties | |
| git commit -am "chore(release): $VERSION" | |
| git push -q -u origin "release-$VERSION" | |
| - name: Open pull request | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh pr create \ | |
| -t "Release ${{ github.event.inputs.version }}" \ | |
| -b "# :rocket: ${{ github.event.inputs.version }} | |
| Make sure to use squash & merge when merging! | |
| Once this is merged, another job will kick off automatically and publish the package. | |
| # :memo: Changelog | |
| $(cat CHANGELOG.md)" |