Create New Release Tag and PR #11
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: Create New Release Tag and PR | |
on: workflow_dispatch | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
create_release_tag: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Maven Central Repository | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: 'maven' | |
- name: Reset staging/main | |
id: staging | |
run: | | |
git checkout -B staging/main | |
git push --set-upstream -f origin staging/main | |
- name: Set Release Version | |
id: release | |
run: | | |
mvn -B versions:set versions:commit -DremoveSnapshot | |
echo "version=$(mvn -B help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT | |
- uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: "Prepare release (${{ github.actor }}): github-api-${{ steps.release.outputs.version }}" | |
tagging_message: 'github-api-${{ steps.release.outputs.version }}' | |
branch: staging/main | |
- name: Increment Snapshot Version | |
run: | | |
mvn versions:set versions:commit -DnextSnapshot | |
- uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: "Prepare for next development iteration" | |
branch: staging/main | |
- name: pull-request to main | |
uses: repo-sync/pull-request@v2 | |
with: | |
pr_title: "Prepare release (${{ github.actor }}): github-api-${{ steps.release.outputs.version }}" | |
source_branch: "staging/main" | |
destination_branch: "main" | |
github_token: ${{ secrets.GITHUB_TOKEN }} |