This repository has been archived by the owner on Oct 20, 2023. It is now read-only.
Merge pull request #562 from StarWishsama/renovate/gradle.plugin.com.… #31
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: Comet Checker | |
on: | |
workflow_dispatch: | |
push: | |
paths: | |
- '**.kt' | |
- '**.kts' | |
- '.github/workflows/*.yml' | |
pull_request: | |
branches: | |
- '*' | |
paths: | |
- '**.kt' | |
- '**.kts' | |
- '.github/workflows/*.yml' | |
jobs: | |
spotlessCheck: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: 设置 JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
cache: gradle | |
- uses: gradle/gradle-build-action@v2 | |
name: 运行 Spotless 检查 | |
with: | |
gradle-version: wrapper | |
arguments: spotlessCheck | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: 设置 JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
cache: gradle | |
- uses: gradle/gradle-build-action@v2 | |
name: 运行测试 | |
with: | |
gradle-version: wrapper | |
arguments: "test --full-stacktrace --scan" | |
- name: "为提交更改添加构建扫描结果链接" | |
uses: actions/github-script@v6 | |
if: github.event_name == 'pull_request' && failure() | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
script: | | |
github.rest.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: '❌ ${{ github.workflow }} 构建失败\nBuild Scan 报告: ${{ steps.gradle.outputs.build-scan-url }}' | |
}) | |
build: | |
needs: [ spotlessCheck, test ] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: 设置 JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
cache: gradle | |
- uses: gradle/gradle-build-action@v2 | |
name: 构建最新 Comet | |
id: build-comet | |
with: | |
arguments: buildComet | |
gradle-version: wrapper | |
- uses: actions/upload-artifact@v3 | |
if: github.event_name == 'push' && github.ref_name == 'dev' | |
with: | |
name: Comet-Bot-full | |
path: comet | |
- name: 自动发布测试版本 | |
uses: marvinpinto/[email protected] | |
if: github.event_name == 'push' && github.ref_name == 'dev' | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
automatic_release_tag: "testing" | |
title: "Comet 测试版" | |
prerelease: false | |
files: | | |
comet/*.jar | |
comet/modules/*.jar |