Create AutoPushCI.yml #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: AutoPushCI | |
on: | |
push: | |
branches: [ "master" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
#安装使用jdk | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
#执行构建 | |
- name: Build with Gradle 7.6 | |
uses: gradle/gradle-build-action@v3.3.2 | |
with: | |
arguments: :buildPlugin | |
#取文件名 | |
- name: Get Plugin Name | |
run: echo "NAME=$(find build/mirai -name "*.jar" -exec basename {} \; | sed 's/\.mirai2.jar/-mirai/')" >> $GITHUB_ENV | |
#上传工件 | |
- name: Upload-Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ env.NAME }} | |
path: build/mirai/*.mirai2.jar | |
dependency-submission: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
# Generates and submits a dependency graph, enabling Dependabot Alerts for all project dependencies. | |
# See: https://github.com/gradle/actions/blob/main/dependency-submission/README.md | |
- name: Generate and submit dependency graph | |
uses: gradle/actions/dependency-submission@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0 |