Java CI with Gradle #47
Workflow file for this run
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: Java CI with Gradle | |
| on: | |
| release: | |
| types: [published] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4.2.2 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v4.7.0 | |
| with: | |
| distribution: temurin | |
| java-version: 25 | |
| - name: Cache generated data | |
| uses: actions/cache@v5.0.4 | |
| with: | |
| path: | | |
| plugin/build/minecraft/ | |
| plugin/build/generated/minecraft/mapping/ | |
| key: minecraft-${{ hashFiles('gradle.properties') }} | |
| - name: Build LimboAPI | |
| run: ./gradlew build | |
| - name: Upload LimboAPI | |
| uses: actions/upload-artifact@v4.6.2 | |
| with: | |
| name: LimboAPI | |
| path: "*/build/libs/*.jar" | |
| - name: Find correct JAR | |
| id: find-jar | |
| run: | | |
| output="$(find plugin/build/libs/ ! -name "*-javadoc.jar" ! -name "*-sources.jar" -type f -printf "%f\n")" | |
| echo "::set-output name=jarname::$output" | |
| - name: Upload to the GitHub release | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ github.event.release.upload_url }} | |
| asset_path: plugin/build/libs/${{ steps.find-jar.outputs.jarname }} | |
| asset_name: ${{ steps.find-jar.outputs.jarname }} | |
| asset_content_type: application/java-archive | |
| - name: Upload to Modrinth | |
| uses: RubixDev/modrinth-upload@v1.0.0 | |
| with: | |
| token: ${{ secrets.MODRINTH_TOKEN }} | |
| file_path: plugin/build/libs/${{ steps.find-jar.outputs.jarname }} | |
| name: Release ${{ github.event.release.tag_name }} | |
| version: ${{ github.event.release.tag_name }} | |
| changelog: ${{ github.event.release.body }} | |
| game_versions: 1.7.2 | |
| release_type: release | |
| loaders: velocity | |
| featured: true | |
| project_id: TZOteSf2 |