diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fb53c31..1e9bee4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,6 @@ jobs: uses: null2264/actions/neoforge-snapshot@8ec887de92fe1614714e8e2e061ffe3299ae68aa with: mc-version: 24w14a - java-version: 21 skip-gradle-setup: 'true' - name: Get mod versions diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f6c02eb..88947d6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,47 +8,41 @@ jobs: name: Build and Release runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: gradle/wrapper-validation-action@v2 - - name: NeoForge Kits Cache - uses: actions/cache@v4 + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Gradle + uses: null2264/actions/gradle-setup@8ec887de92fe1614714e8e2e061ffe3299ae68aa with: - path: ~/Kits - key: ${{ runner.os }}-Kits-${{ hashFiles('snapshot_version') }} - restore-keys: | - ${{ runner.os }}-Kits-${{ hashFiles('snapshot_version') }} - - name: Compile NeoForge snapshot - run: | - ./.scripts/compile_kits.sh - - name: Setup JDK21 - run: | - # REF: https://github.com/actions/runner-images/blob/07d23cf/images/ubuntu/Ubuntu2204-Readme.md#java - echo "JAVA_HOME=$(echo $JAVA_HOME_21_X64)" >> "$GITHUB_ENV" - - name: Setup build environment - run: - chmod +x ./gradlew - echo "org.gradle.java.installations.fromEnv=JAVA_HOME_8_X64,JAVA_HOME_17_X64,JAVA_HOME_21_X64" >> gradle.properties - echo "org.gradle.jvmargs=-Xmx6G" >> gradle.properties - echo "org.gradle.cache.cleanup=false" >> gradle.properties - echo "org.gradle.daemon=false" >> gradle.properties - - name: Gradle Cache - uses: actions/cache@v4 + java: 21 + + - name: Setup NeoForge Kits for snapshots + uses: null2264/actions/neoforge-snapshot@8ec887de92fe1614714e8e2e061ffe3299ae68aa with: - path: ~/.gradle/caches - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', 'gradle.properties') }} - restore-keys: | - ${{ runner.os }}-gradle- + mc-version: 24w14a + skip-gradle-setup: 'true' + + - name: Get mod versions + id: get-mod-versions + run: | + echo "versions=$(ls versions | grep -e '.\.' | tr '\n' ' ')" >> $GITHUB_OUTPUT + - name: Build with Gradle - run: ./.scripts/compile.sh + uses: null2264/actions/replaymod-preprocessor-compile@8ec887de92fe1614714e8e2e061ffe3299ae68aa + with: + versions: ${{ steps.get-mod-versions.outputs.versions }} + - name: Archive build results run: tar -I zstd -cf build.tar.zst versions/*/build/libs - - name: Upload build and gradle folders + + - name: Upload build folders uses: actions/upload-artifact@v4 with: name: build-artifacts path: build.tar.zst if-no-files-found: error retention-days: 3 + - name: Upload to CurseForge and Modrinth run: ./gradlew publishMods --stacktrace --no-daemon --max-workers 1 env: @@ -65,8 +59,10 @@ jobs: uses: actions/download-artifact@v4 with: name: build-artifacts + - name: Unpack build artifact run: tar axf build.tar.zst + - name: Upload Release Artifact uses: softprops/action-gh-release@v1 env: