Tag release and move to next development version #1
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 and move to next development version | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| releaseVersion: | |
| description: "Release version" | |
| required: true | |
| snapshotVersion: | |
| description: "Next snapshot version" | |
| required: true | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout source code | |
| uses: actions/[email protected] | |
| - name: Set up JDK 17 | |
| uses: actions/[email protected] | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| cache: 'maven' | |
| - name: Set up git | |
| run: | | |
| git config --global user.name 'github-actions[bot]' | |
| git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
| - name: Capture versions | |
| run: | | |
| echo RELEASE_VERSION=${{ github.event.inputs.releaseVersion }} >> $GITHUB_ENV | |
| echo SNAPSHOT_VERSION=${{ github.event.inputs.snapshotVersion }} >> $GITHUB_ENV | |
| - name: Tag release | |
| run: | | |
| ./mvnw versions:set -DgenerateBackupPoms=false -DnewVersion=$RELEASE_VERSION | |
| git commit -a -m "Release version $RELEASE_VERSION" | |
| git tag -a v$RELEASE_VERSION -m "Release version $RELEASE_VERSION" | |
| git push origin v$RELEASE_VERSION | |
| - name: Move to next development version | |
| run: | | |
| ./mvnw versions:set -DgenerateBackupPoms=false -DnewVersion=$SNAPSHOT_VERSION | |
| git commit -a -m "Next development version" | |
| git push origin main |