Skip to content

Commit f3af67f

Browse files
committed
Update: Action
1 parent 80496f6 commit f3af67f

3 files changed

Lines changed: 174 additions & 86 deletions

File tree

.github/workflows/gradle.yml

Lines changed: 35 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -22,30 +22,38 @@ jobs:
2222
runs-on: ubuntu-latest
2323

2424
steps:
25-
- uses: actions/checkout@v3
26-
- name: Set up JDK 11
27-
uses: actions/setup-java@v3
28-
with:
29-
java-version: '11'
30-
distribution: 'temurin'
31-
- name: Grant execute permission for gradlew
32-
run: chmod +x ./gradlew
33-
- name: Build Plugin
34-
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
35-
with:
36-
arguments: buildPlugin
37-
- name: Build Plugin Legacy
38-
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
39-
with:
40-
arguments: buildPluginLegacy
41-
#取文件名
42-
- name: Get Plugin Name
43-
run: echo "NAME=$(find /home/runner/work/mirai-plugins-pixiv/mirai-plugins-pixiv/build/mirai -name "*mirai.jar" -exec basename {} \; | sed 's/\.mirai.jar/-mirai/')" >> $GITHUB_ENV
44-
- name: Upload a Build Artifact
45-
uses: actions/upload-artifact@v3.1.0
46-
if: success()
47-
with:
48-
name: ${{ env.NAME }}
49-
path: /home/runner/work/mirai-plugins-pixiv/mirai-plugins-pixiv/build/mirai/*.jar
50-
retention-days: 0
51-
if-no-files-found: error
25+
- uses: actions/checkout@v4
26+
- name: Set up JDK 11
27+
uses: actions/setup-java@v4
28+
with:
29+
java-version: '11'
30+
distribution: 'temurin'
31+
- name: Grant execute permission for gradlew
32+
run: chmod +x ./gradlew
33+
- name: Build Plugin
34+
uses: gradle/gradle-build-action@v3
35+
with:
36+
arguments: buildPlugin
37+
- name: Build Plugin Legacy
38+
uses: gradle/gradle-build-action@v3
39+
with:
40+
arguments: buildPluginLegacy
41+
- name: Build Overflow Plugin
42+
uses: gradle/gradle-build-action@v3
43+
with:
44+
arguments: buildPlugin -Poverflow
45+
- name: Build Overflow Plugin Legacy
46+
uses: gradle/gradle-build-action@v3
47+
with:
48+
arguments: buildPluginLegacy -Poverflow
49+
#取文件名
50+
- name: Get Plugin Name
51+
run: echo "NAME=$(find /home/runner/work/mirai-plugins-pixiv/mirai-plugins-pixiv/build/mirai -name "*mirai.jar" -exec basename {} \; | sed 's/\.mirai.jar/-mirai/')" >> $GITHUB_ENV
52+
- name: Upload a Build Artifact
53+
uses: actions/upload-artifact@v4
54+
if: success()
55+
with:
56+
name: ${{ env.NAME }}
57+
path: /home/runner/work/mirai-plugins-pixiv/mirai-plugins-pixiv/build/mirai/*.jar
58+
retention-days: 0
59+
if-no-files-found: error

build.gradle.kts

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ plugins {
1313
}
1414

1515
group = "com.hcyacg"
16-
version = "1.7.8"
16+
val tempVersion = "1.7.8"
17+
version = tempVersion
1718

1819
repositories {
1920
maven("https://maven.aliyun.com/repository/central")
@@ -24,10 +25,15 @@ repositories {
2425

2526
dependencies {
2627
implementation("org.apache.commons:commons-lang3:3.17.0")
27-
28-
// val overflowVersion = "2.16.0-a1e9d27-SNAPSHOT"
29-
// compileOnly("top.mrxiaom:overflow-core-api:$overflowVersion")
30-
// testConsoleRuntime("top.mrxiaom:overflow-core:$overflowVersion")
28+
29+
// 根据项目属性动态添加的依赖项
30+
if (project.hasProperty("overflow")) {
31+
val overflowVersion = "1.0.0.519-0d68f08-SNAPSHOT"
32+
compileOnly("top.mrxiaom.mirai:overflow-core-api:$overflowVersion")
33+
testConsoleRuntime("top.mrxiaom.mirai:overflow-core:$overflowVersion")
34+
version = "$tempVersion-overfolw"
35+
}
36+
3137

3238
implementation("commons-codec:commons-codec:1.17.1")
3339
implementation("org.apache.httpcomponents.client5:httpclient5:5.4.1")
@@ -42,11 +48,23 @@ dependencies {
4248

4349
}
4450

51+
mirai {
52+
if (project.hasProperty("overflow")) {
53+
noTestCore = true
54+
setupConsoleTestRuntime {
55+
// 移除 mirai-core 依赖
56+
classpath = classpath.filter {
57+
!it.nameWithoutExtension.startsWith("mirai-core-jvm")
58+
}
59+
}
60+
}
61+
}
62+
4563
noArg {
4664
annotation("com.hcyacg.anno.NoArgOpenDataClass")
4765
}
4866

49-
allOpen{
67+
allOpen {
5068
annotation("com.hcyacg.anno.NoArgOpenDataClass")
5169
}
5270

0 commit comments

Comments
 (0)