diff --git a/.github/workflows/gradle_build.yml b/.github/workflows/gradle_build.yml index e2f5906..1881f3a 100644 --- a/.github/workflows/gradle_build.yml +++ b/.github/workflows/gradle_build.yml @@ -1,41 +1,34 @@ -name: Gradle Build +name: Build -on: - push: - branches: - - '*' - pull_request: - branches: - - '*' +on: [ pull_request, push, workflow_dispatch ] jobs: - build: - strategy: - matrix: - java: [ 17 ] - runs-on: ubuntu-latest + Build: + runs-on: ubuntu-22.04 + steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v3 + - uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v4 with: - java-version: ${{ matrix.java }} distribution: 'temurin' - - - name: Build with Gradle - uses: gradle/gradle-build-action@v2 + java-version: 17 + - name: Cache + uses: actions/cache@v4 with: - arguments: build --parallel --stacktrace - cache-read-only: ${{ !startsWith(github.ref, 'refs/heads/1.') && !startsWith(github.ref, 'refs/heads/dev/') && !startsWith(github.ref, 'refs/tags/v') }} - - - uses: actions/upload-artifact@v2 - with: - name: Artifacts-neoforge - path: ./neoforge/build/libs/ - - - uses: actions/upload-artifact@v2 + path: | + ~/.gradle/caches + ~/.gradle/wrapper + .gradle + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', 'build.gradle') }} + - name: Build with Gradle + run: | + chmod +x gradlew + ./gradlew build + - name: Upload artifacts + uses: actions/upload-artifact@v4 with: - name: Artifacts-fabric - path: ./fabric/build/libs/ \ No newline at end of file + name: Artifacts + path: | + ${{ github.workspace }}/neoforge/build/libs + ${{ github.workspace }}/fabric/build/libs \ No newline at end of file diff --git a/.github/workflows/gradle_publish.yml b/.github/workflows/gradle_publish.yml index f70202b..052b424 100644 --- a/.github/workflows/gradle_publish.yml +++ b/.github/workflows/gradle_publish.yml @@ -14,24 +14,24 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up JDK 20 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: 'adopt' java-version: 20 - name: Cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | ~/.gradle/caches ~/.gradle/wrapper .gradle key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', 'build.gradle') }} - - uses: gradle/wrapper-validation-action@v1 + - uses: gradle/actions/wrapper-validation@v3 - run: | chmod +x gradlew - ./gradlew build publishUnified --stacktrace + ./gradlew build publishMod --stacktrace -Porg.gradle.parallel.threads=4 env: CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}