Build & Release Mod #4
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: Build & Release Mod | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: "mod version" | |
| required: true | |
| type: string | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 17 | |
| distribution: 'temurin' | |
| - name: Make Gradle executable | |
| run: chmod +x ./gradlew | |
| - name: Build mod | |
| run: ./gradlew build | |
| - name: Find artifact (Mod JAR) | |
| id: findJar | |
| run: | | |
| FILE=$(find build/libs -name "*.jar" | head -n 1) | |
| echo "file=$FILE" >> $GITHUB_OUTPUT | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: v${{ github.event.inputs.version }} | |
| name: "Version ${{ github.event.inputs.version }}" | |
| files: ${{ steps.findJar.outputs.file }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |