Release #6
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: Release | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| releaseVersion: | |
| description: 'Release version (e.g., 0.1.0)' | |
| required: true | |
| nextVersion: | |
| description: 'Next development version (e.g., 0.2.0-SNAPSHOT)' | |
| required: true | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| fetch-depth: 0 | |
| - uses: graalvm/setup-graalvm@v1 | |
| with: | |
| java-version: '25' | |
| distribution: 'graalvm' | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Cache Maven packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven- | |
| - name: Configure Git | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| - name: Set release version | |
| run: ./mvnw -batch-mode versions:set -DnewVersion=${{ github.event.inputs.releaseVersion }} -DgenerateBackupPoms=false | |
| - name: Build and test | |
| run: ./mvnw -batch-mode clean install | |
| - name: Commit release version | |
| run: | | |
| git add -A | |
| git commit -m "Release ${{ github.event.inputs.releaseVersion }}" | |
| git tag v${{ github.event.inputs.releaseVersion }} | |
| - name: Publish to GitHub Packages | |
| run: ./mvnw -batch-mode deploy -DskipTests -s .github/settings.xml | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set next development version | |
| run: ./mvnw -batch-mode versions:set -DnewVersion=${{ github.event.inputs.nextVersion }} -DgenerateBackupPoms=false | |
| - name: Commit next development version | |
| run: | | |
| git add -A | |
| git commit -m "Prepare next development iteration ${{ github.event.inputs.nextVersion }}" | |
| - name: Push changes and tags | |
| run: | | |
| git push origin HEAD:main | |
| git push origin v${{ github.event.inputs.releaseVersion }} | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: v${{ github.event.inputs.releaseVersion }} | |
| name: Release ${{ github.event.inputs.releaseVersion }} | |
| generate_release_notes: true |