Tag Release #4
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: Tag Release | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| git-tag: | |
| description: 'The git tag which gets generated (also the version inside the pom.xml)' | |
| required: true | |
| default: 1.0.0 | |
| new-version: | |
| description: 'The new version after the release (without SNAPSHOT)' | |
| required: true | |
| default: 1.1.0 | |
| jobs: | |
| tag-release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: master | |
| fetch-depth: 0 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: '21' | |
| distribution: 'oracle' | |
| architecture: x64 | |
| - name: Setup Git config | |
| run: | | |
| git config user.name "GitHub Actions Bot" | |
| git config user.email "<>" | |
| - name: Set release version | |
| run: | | |
| mvn versions:set -DnewVersion=${{github.event.inputs.git-tag}} -DgenerateBackupPoms=false | |
| git add . | |
| git commit -m "Set release version" | |
| git push origin master | |
| git tag ${{github.event.inputs.git-tag}} | |
| git push origin ${{github.event.inputs.git-tag}} | |
| - name: Maven build | |
| run: mvn clean install | |
| - name: Set new version | |
| run: | | |
| mvn versions:set -DnewVersion=${{github.event.inputs.new-version}}-SNAPSHOT -DgenerateBackupPoms=false | |
| git add . | |
| git commit -m "Set new SNAPSHOT version" | |
| git push origin master |