From 6aa19ce86094e9411e514f36c6459d29044c0129 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E5=9D=97=E5=90=9B?= Date: Tue, 26 Jul 2022 19:20:42 +0800 Subject: [PATCH] Add github actions --- .github/workflows/build.yml | 47 +++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..5b5ea69 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,47 @@ +name: "Build" +on: + workflow_dispatch: ~ + push: + paths: + - "**.java" + branches: + - "main" + pull_request: + paths: + - "**.java" + types: + - opened + - synchronize + - reopened +jobs: + Build-Server-Jar: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Java + uses: actions/setup-java@v3 + with: + distribution: temurin + java-version: '17' + - name: Cache gradle files + uses: actions/cache@v2 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + ./.gradle/loom-cache + key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle', 'gradle.properties', '**/*.accesswidener') }} + restore-keys: | + ${{ runner.os }}-gradle- + - name: Download latest grasscutter jar + run: wget https://nightly.link/Grasscutters/Grasscutter/workflows/build/development/Grasscutter.zip && mkdir lib && unzip Grasscutter.zip -d lib + + - name: Run Gradle + run: ./gradlew jar + + - name: Upload build + uses: actions/upload-artifact@v3 + with: + name: mojoconsole + path: opencommand*.jar \ No newline at end of file