diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 04fbbdb..3eefceb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,38 +1,51 @@ -name: Build +name: Java CI with Gradle -on: [ pull_request, push, workflow_dispatch ] +on: + push: + branches: [ "1.16.5" ] + pull_request: + branches: [ "1.16.5" ] + workflow_dispatch: jobs: - Build: - runs-on: ubuntu-22.04 + build: + + runs-on: ubuntu-latest + permissions: + contents: read steps: - - uses: actions/checkout@v3 - - - name: Set up JDK 17 - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: 17 - - name: Cache - uses: actions/cache@v2 - with: - 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 (fabric) - uses: actions/upload-artifact@v3 - with: - name: fabric - path: ${{ github.workspace }}/fabric/build/libs - - name: Upload artifacts (forge) - uses: actions/upload-artifact@v3 - with: - name: forge - path: ${{ github.workspace }}/forge/build/libs \ No newline at end of file + - uses: actions/checkout@v4 + + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + + - name: Cache + uses: actions/cache@v4 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + .gradle + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', 'build.gradle') }} + + - name: Build with Gradle Wrapper + run: | + chmod +x gradlew + ./gradlew build + + - name: Upload artifacts (fabric) + uses: actions/upload-artifact@v4 + with: + name: fabric + path: ${{ github.workspace }}/fabric/build/libs + + - name: Upload artifacts (forge) + uses: actions/upload-artifact@v4 + with: + name: forge + path: ${{ github.workspace }}/forge/build/libs +