Build+24 release/2.0.1 #24
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: 'The version of the release (e.g. 1.0.0)' | |
| required: true | |
| type: string | |
| run-name: Build+${{ github.run_number }} release/${{ inputs.version }} | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| name: 🎉 Release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Check version in gradle.properties | |
| run: | | |
| MOD_VERSION=$(grep "^mod_version=" gradle.properties | cut -d'=' -f2) | |
| echo "Found mod version: $MOD_VERSION" | |
| if [ "$MOD_VERSION" != "${{ inputs.version }}" ]; then | |
| echo "Version mismatch! gradle.properties=$MOD_VERSION input=${{ inputs.version }}" | |
| exit 1 | |
| fi | |
| - name: Set up JDK | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: '23' | |
| distribution: 'temurin' | |
| cache: gradle | |
| - name: Make gradle wrapper executable | |
| run: chmod +x ./gradlew | |
| - name: Build with Gradle | |
| run: ./gradlew build --full-stacktrace | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: Artifacts | |
| path: build/libs/ | |
| - name: Create release notes | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| tag: ${{ inputs.version }} | |
| run: | | |
| gh release create "$tag" \ | |
| --target main \ | |
| --repo="$GITHUB_REPOSITORY" \ | |
| --title="$tag" \ | |
| --generate-notes |