diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 25840b6..a7b397e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,24 +1,40 @@ -name: Java CI with Gradle +name: Build -on: [ pull_request, push ] +on: [ pull_request, push, workflow_dispatch ] jobs: - build: + Build: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 + - name: Get github short hash + id: github_short_hash + run: echo "result=$(git rev-parse --short "${{ github.sha }}")" >> $GITHUB_OUTPUT - name: Set up JDK 17 uses: actions/setup-java@v3 with: distribution: 'temurin' java-version: 17 - - name: Grant execute permission for Gradlew - run: chmod +x gradlew + - name: Cache + uses: actions/cache@v3 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + .gradle + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', 'build.gradle') }} - name: Build with Gradle - run: ./gradlew build - - name: Upload build artifacts + run: | + chmod +x gradlew + ./gradlew build + - name: Upload artifacts (fabric) + uses: actions/upload-artifact@v3 + with: + name: Artifacts-fabric + path: ${{ github.workspace }}/fabric/build/libs + - name: Upload artifacts (forge) uses: actions/upload-artifact@v3 with: - name: Artifacts - path: build/libs + name: Artifacts-forge + path: ${{ github.workspace }}/forge/build/libs