Plex-FAWE/.github/workflows/build.yml

56 lines
1.9 KiB
YAML
Raw Normal View History

2020-11-23 17:49:08 +00:00
name: "build"
on: ["pull_request", "push"]
jobs:
build:
strategy:
matrix:
2021-02-18 19:19:37 +00:00
os: ["ubuntu-latest"]
2020-11-23 17:49:08 +00:00
runs-on: "${{ matrix.os }}"
steps:
- name: "Checkout Repository"
uses: "actions/checkout@v2.3.4"
- name: "Setup JDK 11"
2021-04-05 21:02:56 +00:00
uses: "actions/setup-java@v2"
2020-11-23 17:49:08 +00:00
with:
2021-04-05 21:02:56 +00:00
distribution: "adopt"
java-version: "11"
2020-11-23 17:49:08 +00:00
- name: "Cache Gradle"
2021-02-18 19:19:37 +00:00
uses: "actions/cache@v2.1.4"
2020-11-23 17:49:08 +00:00
with:
path: |
"~/.gradle/caches"
"~/.gradle/wrapper"
2021-02-18 19:19:37 +00:00
key: "${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}"
2020-11-23 17:49:08 +00:00
restore-keys: |
2021-02-18 19:19:37 +00:00
"${{ runner.os }}-gradle-"
2020-11-23 17:49:08 +00:00
- name: "Cache Local Maven Repository"
2021-02-18 19:19:37 +00:00
uses: "actions/cache@v2.1.4"
2020-11-23 17:49:08 +00:00
with:
path: "~/.m2/repository"
key: "${{ runner.os }}-11-maven-${{ hashFiles('**/pom.xml') }}"
2020-11-23 17:49:08 +00:00
restore-keys: |
"${{ runner.os }}-11-maven-"
2020-11-23 17:49:08 +00:00
- name: "Cache BuildTools Decompiled Code"
2021-02-18 19:19:37 +00:00
uses: "actions/cache@v2.1.4"
2020-11-23 17:49:08 +00:00
with:
path: "$GITHUB_WORKSPACE/work"
key: "${{ runner.os }}-buildtools"
restore-keys: |
"${{ runner.os }}-buildtools"
- name: "Test Environment"
2020-11-23 17:49:08 +00:00
run: "echo $GITHUB_WORKSPACE"
- name: "Download BuildTools"
run: "wget https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar"
- name: "Run BuildTools"
2021-01-19 18:50:43 +00:00
run: "java -jar BuildTools.jar --rev 1.16.5"
2020-11-23 17:49:08 +00:00
- name: "Clean Build"
run: "./gradlew clean build sourcesJar javadocJar"
2021-02-18 19:19:37 +00:00
- name: Cleanup Gradle Cache
# Remove some files from the Gradle cache, so they aren't cached by GitHub Actions.
# Restoring these files from a GitHub Actions cache might cause problems for future builds.
run: |
rm -f ~/.gradle/caches/modules-2/modules-2.lock
rm -f ~/.gradle/caches/modules-2/gc.properties