Release #53
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: | |
| version: | |
| description: 'Release version' | |
| required: false | |
| env: | |
| JDK_DISTRIBUTION: zulu | |
| JDK_VERSION_LATEST_LTS: 21 | |
| jobs: | |
| release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Assign input version | |
| if: github.event.inputs.version != null | |
| run: echo "RELEASE_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV | |
| - name: Get latest draft release title | |
| if: github.event.inputs.version == null | |
| run: | | |
| TITLE=$(gh api repos/${{ github.repository }}/releases \ | |
| --jq '.[] | select(.draft==true) | .name' | head -n 1) | |
| if [[ -z "$TITLE" ]]; then | |
| echo "No draft release found." | |
| exit 1 | |
| fi | |
| echo "RELEASE_VERSION=$TITLE" >> $GITHUB_ENV | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up the latest LTS JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: ${{ env.JDK_DISTRIBUTION }} | |
| java-version: ${{ env.JDK_VERSION_LATEST_LTS }} | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.REPO_ACCESS_TOKEN }} | |
| - name: Prepare git config | |
| run: | | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| - name: Set up Gradle | |
| uses: gradle/actions/setup-gradle@v4.4.1 | |
| - name: Release ${{ env.RELEASE_VERSION }} | |
| run: > | |
| ./gradlew | |
| -Prelease.releaseVersion=${{ env.RELEASE_VERSION }} | |
| release | |
| - name: Upload reports | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build | |
| path: ./**/build/reports |