|
@@ -17,59 +17,158 @@ on:
|
|
default: 'false'
|
|
default: 'false'
|
|
|
|
|
|
jobs:
|
|
jobs:
|
|
|
|
+ validate-gradle:
|
|
|
|
+ name: "Validate Gradle wrapper"
|
|
|
|
+ runs-on: ubuntu-20.04
|
|
|
|
+ steps:
|
|
|
|
+ - uses: actions/checkout@v2
|
|
|
|
+ with:
|
|
|
|
+ fetch-depth: 0
|
|
|
|
+
|
|
|
|
+ - uses: gradle/wrapper-validation-action@v1
|
|
|
|
+ license:
|
|
|
|
+ name: "Verify License integrity"
|
|
|
|
+ runs-on: ubuntu-20.04
|
|
|
|
+ if: |
|
|
|
|
+ !contains(github.event.head_commit.message, '[ci skip]')
|
|
|
|
+ steps:
|
|
|
|
+ - uses: actions/checkout@v2
|
|
|
|
+
|
|
|
|
+ - name: Set up JDK 8
|
|
|
|
+ uses: actions/setup-java@v2
|
|
|
|
+ with:
|
|
|
|
+ java-version: 8
|
|
|
|
+ distribution: 'adopt'
|
|
|
|
+
|
|
|
|
+ - name: Cache Gradle wrapper
|
|
|
|
+ uses: actions/cache@v2
|
|
|
|
+ with:
|
|
|
|
+ path: ~/.gradle/wrapper
|
|
|
|
+ key: gradle-wrapper-${{ runner.os }}-${{ hashFiles('gradle/wrapper/**/*') }}
|
|
|
|
+ restore-keys: gradle-wrapper-${{ runner.os }}-
|
|
|
|
+
|
|
|
|
+ - name: Cache packages
|
|
|
|
+ id: cache-packages
|
|
|
|
+ uses: actions/cache@v2
|
|
|
|
+ with:
|
|
|
|
+ path: ~/.gradle/caches
|
|
|
|
+ key: gradle-packages-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
|
|
|
+ restore-keys: gradle-packages-${{ runner.os }}-
|
|
|
|
+
|
|
|
|
+ - name: Make gradlew executable
|
|
|
|
+ run: chmod +x ./gradlew
|
|
|
|
+
|
|
|
|
+ - name: Verify license using Licenser
|
|
|
|
+ run: |
|
|
|
|
+ ./gradlew licenseCheck
|
|
|
|
+
|
|
|
|
+ # Remove some potentially problematic files from the Gradle cache,
|
|
|
|
+ # so that GitHub Actions doesn't cache them.
|
|
|
|
+ - name: Cleanup Gradle Cache
|
|
|
|
+ if: steps.cache-packages.outputs.cache-hit != 'true'
|
|
|
|
+ run: |
|
|
|
|
+ rm -f $HOME/.gradle/caches/*/*.lock
|
|
|
|
+ rm -rf $HOME/.gradle/caches/*/plugin-resolution/
|
|
|
|
+ rm -rf $HOME/.gradle/caches/*/scripts/
|
|
|
|
+ rm -rf $HOME/.gradle/caches/*/scripts-remapped/
|
|
|
|
+ rm -rf $HOME/.gradle/caches/*/fileHashes/
|
|
|
|
+ rm -f $HOME/.gradle/caches/journal-1/file-access.bin
|
|
|
|
+
|
|
build:
|
|
build:
|
|
|
|
+ name: "Build"
|
|
strategy:
|
|
strategy:
|
|
matrix:
|
|
matrix:
|
|
- java: [ 8-jdk, 11-jdk, 15-jdk ]
|
|
|
|
|
|
+ java: [ 8, 11, 15 ]
|
|
runs-on: ubuntu-20.04
|
|
runs-on: ubuntu-20.04
|
|
- container:
|
|
|
|
- image: openjdk:${{ matrix.java }}
|
|
|
|
- options: --user root
|
|
|
|
if: |
|
|
if: |
|
|
!contains(github.event.head_commit.message, '[ci skip]')
|
|
!contains(github.event.head_commit.message, '[ci skip]')
|
|
steps:
|
|
steps:
|
|
- - uses: actions/cache@v2
|
|
|
|
- with:
|
|
|
|
- path: |
|
|
|
|
- ~/.gradle/caches
|
|
|
|
- ~/.gradle/wrapper
|
|
|
|
- key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
|
|
|
- restore-keys: |
|
|
|
|
- ${{ runner.os }}-gradle-
|
|
|
|
- # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
|
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/checkout@v2
|
|
- - uses: gradle/wrapper-validation-action@v1
|
|
|
|
|
|
+
|
|
|
|
+ - name: Set up JDK ${{ matrix.java }}
|
|
|
|
+ uses: actions/setup-java@v2
|
|
|
|
+ with:
|
|
|
|
+ java-version: ${{ matrix.java }}
|
|
|
|
+ distribution: 'adopt'
|
|
|
|
+
|
|
|
|
+ - name: Cache Gradle wrapper
|
|
|
|
+ uses: actions/cache@v2
|
|
|
|
+ with:
|
|
|
|
+ path: ~/.gradle/wrapper
|
|
|
|
+ key: gradle-wrapper-${{ runner.os }}-${{ hashFiles('gradle/wrapper/**/*') }}
|
|
|
|
+ restore-keys: gradle-wrapper-${{ runner.os }}-
|
|
|
|
+
|
|
|
|
+ - name: Cache packages
|
|
|
|
+ id: cache-packages
|
|
|
|
+ uses: actions/cache@v2
|
|
|
|
+ with:
|
|
|
|
+ path: ~/.gradle/caches
|
|
|
|
+ key: gradle-packages-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
|
|
|
+ restore-keys: gradle-packages-${{ runner.os }}-
|
|
|
|
+
|
|
|
|
+ - name: Make gradlew executable
|
|
|
|
+ run: chmod +x ./gradlew
|
|
|
|
+
|
|
- name: Build with Gradle
|
|
- name: Build with Gradle
|
|
run: |
|
|
run: |
|
|
./gradlew build --stacktrace --no-daemon
|
|
./gradlew build --stacktrace --no-daemon
|
|
|
|
+
|
|
|
|
+ # Remove some potentially problematic files from the Gradle cache,
|
|
|
|
+ # so that GitHub Actions doesn't cache them.
|
|
|
|
+ - name: Cleanup Gradle Cache
|
|
|
|
+ if: steps.cache-packages.outputs.cache-hit != 'true'
|
|
|
|
+ run: |
|
|
|
|
+ rm -f $HOME/.gradle/caches/*/*.lock
|
|
|
|
+ rm -rf $HOME/.gradle/caches/*/plugin-resolution/
|
|
|
|
+ rm -rf $HOME/.gradle/caches/*/scripts/
|
|
|
|
+ rm -rf $HOME/.gradle/caches/*/scripts-remapped/
|
|
|
|
+ rm -rf $HOME/.gradle/caches/*/fileHashes/
|
|
|
|
+ rm -f $HOME/.gradle/caches/journal-1/file-access.bin
|
|
|
|
+
|
|
- name: Upload Artifacts
|
|
- name: Upload Artifacts
|
|
uses: actions/upload-artifact@v2
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
with:
|
|
- name: '${{ github.event.repository.name }} Build #${{ github.run_number }}'
|
|
|
|
|
|
+ name: 'Build Artifacts (JDK ${{ matrix.java }}, Build #${{ github.run_number }})'
|
|
path: |
|
|
path: |
|
|
**/build/libs/
|
|
**/build/libs/
|
|
!build/libs/
|
|
!build/libs/
|
|
|
|
+ !**/*-dev.jar
|
|
!**/*-shadow.jar
|
|
!**/*-shadow.jar
|
|
- !**/*-transformProduction([\w]+).jar
|
|
|
|
|
|
+ !**/*-transformProduction*.jar
|
|
|
|
+ !**/testmod*/
|
|
|
|
+
|
|
publish:
|
|
publish:
|
|
- needs: build
|
|
|
|
|
|
+ needs:
|
|
|
|
+ - validate-gradle
|
|
|
|
+ - license
|
|
|
|
+ - build
|
|
runs-on: ubuntu-20.04
|
|
runs-on: ubuntu-20.04
|
|
- container:
|
|
|
|
- image: openjdk:${{ matrix.java }}
|
|
|
|
- options: --user root
|
|
|
|
if: |
|
|
if: |
|
|
!contains(github.event.head_commit.message, '[norelease]') && github.event.inputs.norelease != 'true'
|
|
!contains(github.event.head_commit.message, '[norelease]') && github.event.inputs.norelease != 'true'
|
|
steps:
|
|
steps:
|
|
- - uses: actions/cache@v2
|
|
|
|
- with:
|
|
|
|
- path: |
|
|
|
|
- ~/.gradle/caches
|
|
|
|
- ~/.gradle/wrapper
|
|
|
|
- key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
|
|
|
- restore-keys: |
|
|
|
|
- ${{ runner.os }}-gradle-
|
|
|
|
- # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
|
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/checkout@v2
|
|
|
|
+
|
|
|
|
+ - name: Set up JDK 8
|
|
|
|
+ uses: actions/setup-java@v2
|
|
|
|
+ with:
|
|
|
|
+ java-version: 8
|
|
|
|
+ distribution: 'adopt'
|
|
|
|
+
|
|
|
|
+ - name: Cache Gradle wrapper
|
|
|
|
+ uses: actions/cache@v2
|
|
|
|
+ with:
|
|
|
|
+ path: ~/.gradle/wrapper
|
|
|
|
+ key: gradle-wrapper-${{ runner.os }}-${{ hashFiles('gradle/wrapper/**/*') }}
|
|
|
|
+ restore-keys: gradle-wrapper-${{ runner.os }}-
|
|
|
|
+
|
|
|
|
+ - name: Cache packages
|
|
|
|
+ id: cache-packages
|
|
|
|
+ uses: actions/cache@v2
|
|
|
|
+ with:
|
|
|
|
+ path: ~/.gradle/caches
|
|
|
|
+ key: gradle-packages-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
|
|
|
+ restore-keys: gradle-packages-${{ runner.os }}-
|
|
|
|
+
|
|
- name: Release to Maven and CurseForge
|
|
- name: Release to Maven and CurseForge
|
|
env:
|
|
env:
|
|
# currently unused, may want to use these for changelogs though!
|
|
# currently unused, may want to use these for changelogs though!
|
|
@@ -80,3 +179,15 @@ jobs:
|
|
# TODO: make this use the artifacts from the previous build step
|
|
# TODO: make this use the artifacts from the previous build step
|
|
run: |
|
|
run: |
|
|
./gradlew build publish curseforgePublish --stacktrace --no-daemon
|
|
./gradlew build publish curseforgePublish --stacktrace --no-daemon
|
|
|
|
+
|
|
|
|
+ # Remove some potentially problematic files from the Gradle cache,
|
|
|
|
+ # so that GitHub Actions doesn't cache them.
|
|
|
|
+ - name: Cleanup Gradle Cache
|
|
|
|
+ if: steps.cache-packages.outputs.cache-hit != 'true'
|
|
|
|
+ run: |
|
|
|
|
+ rm -f $HOME/.gradle/caches/*/*.lock
|
|
|
|
+ rm -rf $HOME/.gradle/caches/*/plugin-resolution/
|
|
|
|
+ rm -rf $HOME/.gradle/caches/*/scripts/
|
|
|
|
+ rm -rf $HOME/.gradle/caches/*/scripts-remapped/
|
|
|
|
+ rm -rf $HOME/.gradle/caches/*/fileHashes/
|
|
|
|
+ rm -f $HOME/.gradle/caches/journal-1/file-access.bin
|