diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index be24bfc9..dc7e279a 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -1,48 +1,53 @@ -name: build +# Build Workflow + +name: Build on: - push: - branches: '*' - paths-ignore: - - 'README.md' - - 'LICENSE' - - '.gitignore' pull_request: - branches: '*' - paths-ignore: - - 'README.md' - - 'LICENSE' - - '.gitignore' workflow_dispatch: + push: concurrency: - # Maximum of one running workflow per pull request source branch - # or branch and run number combination (cancels old run if action is rerun) group: ${{ github.head_ref || format('{0}-{1}', github.ref, github.run_number) }} cancel-in-progress: true jobs: build: - name: "Build" - runs-on: "ubuntu-latest" + name: Build - steps: - - uses: actions/checkout@v2 + runs-on: ubuntu-latest - - uses: gradle/wrapper-validation-action@v1 + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 - - uses: actions/setup-java@v2 + - name: Set up JDK 17 + uses: actions/setup-java@v2 with: - distribution: "temurin" - java-version: "17" + java-version: 17 + distribution: temurin + cache: 'gradle' - uses: actions/cache@v2 with: path: | ~/.gradle/caches ~/.gradle/wrapper - key: ${{ runner.os }}-gradle-v2-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + **/loom-cache + **/prebundled-jars + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} restore-keys: | - ${{ runner.os }}-gradle-v2- - - run: chmod +x ./gradlew - - run: ./gradlew --no-daemon build + ${{ runner.os }}-gradle- + - name: Chmod Gradle + run: chmod +x ./gradlew + + - name: Build + run: ./gradlew build --no-daemon + + - name: Upload Build Artifacts + uses: actions/upload-artifact@v2 + with: + name: artifacts + path: build/libs