Release Version #3
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 Version | |
| on: | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v3 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| - name: Cache Maven dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-maven- | |
| - name: Compile and Test with Maven | |
| run: mvn clean install javadoc:javadoc | |
| - name: Get project version | |
| id: get_version | |
| run: | | |
| VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| - name: Get final JAR name | |
| id: get_jar | |
| run: | | |
| JAR_FILE=$(mvn help:evaluate -Dexpression=project.build.finalName -q -DforceStdout).jar | |
| echo "jar=$JAR_FILE" >> $GITHUB_OUTPUT | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.get_version.outputs.version }} | |
| name: zAPI ${{ steps.get_version.outputs.version }} | |
| body_path: changelog.md | |
| files: target/${{ steps.get_jar.outputs.jar }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Upload target artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: zAPI ${{ steps.get_version.outputs.version }} | |
| path: target/ |