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: | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: 21 | |
| - name: Read mod version | |
| id: version | |
| run: | | |
| VERSION=$(grep mod_version gradle.properties | cut -d'=' -f2) | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| - name: Create tag | |
| run: | | |
| git tag v${{ steps.version.outputs.version }} | |
| git push origin v${{ steps.version.outputs.version }} | |
| - name: Grant execute permission | |
| run: chmod +x gradlew | |
| - name: Build project | |
| run: ./gradlew build | |
| - name: Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: v${{ steps.version.outputs.version }} | |
| files: build/libs/* | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |