Cleanup to build.gradle and fixing GH Actions #5
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 | |
| on: [ push, pull_request ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: gradle/actions/[email protected] | |
| - name: Setup Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 21 | |
| distribution: temurin | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Setup Gradle | |
| uses: gradle/actions/[email protected] | |
| - name: Build project | |
| run: ./gradlew buildAndCollect | |
| - name: Find jars | |
| id: find_jars | |
| run: | | |
| EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) | |
| echo "jars<<$EOF" >> $GITHUB_OUTPUT | |
| find ./build/libs/ -type f -name "*.jar" ! -name "*-sources.jar" >> $GITHUB_OUTPUT | |
| echo "$EOF" >> $GITHUB_OUTPUT | |
| - name: Get MC version and mod version | |
| uses: christian-draeger/[email protected] | |
| id: read_properties | |
| with: | |
| path: gradle.properties | |
| properties: 'mod_version' | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: linkart-refabricated-${{ steps.read_properties.outputs.mod_version }}+build.${{ github.run_number }} | |
| path: ${{ steps.find_jars.outputs.jars }} |