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.
This commit is contained in:
2026-08-02 21:54:22 +08:00
parent e4e3a0a537
commit 9ea14a681a
+47
View File
@@ -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