From 9ea14a681a68b8a056552fd427793762af97e543 Mon Sep 17 00:00:00 2001 From: jie65535 Date: Sun, 2 Aug 2026 21:54:22 +0800 Subject: [PATCH] ci: add verified plugin build workflow Build and test with JDK 17 while preserving the Java 11 bytecode target, cache Gradle dependencies, and upload the packaged Mirai plugin. --- .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..0dece19 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,47 @@ +name: Build and Test + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: build-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Check out repository + uses: actions/checkout@v7 + with: + persist-credentials: false + + - name: Set up JDK 17 + uses: actions/setup-java@v5 + with: + java-version: '17' + distribution: temurin + + - name: Set up Gradle + uses: gradle/actions/setup-gradle@v6 + + - name: Build and test + run: | + chmod +x gradlew + ./gradlew build buildPlugin --console=plain + + - name: Upload plugin + uses: actions/upload-artifact@v7 + with: + name: JChatGPT-${{ github.sha }} + path: build/mirai/*.mirai2.jar + if-no-files-found: error + retention-days: 14