Skip to content

Commit 93da7cd

Browse files
authored
Merge pull request #64 from YuLinLoli/1.1.0
fix and feat
2 parents cf6578a + 35fd2f2 commit 93da7cd

File tree

7 files changed

+91
-12
lines changed

7 files changed

+91
-12
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
6+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
7+
8+
name: AutoUploadReleaseBuild
9+
10+
on:
11+
push:
12+
tags:
13+
- 'v*'
14+
jobs:
15+
CreateRelease:
16+
runs-on: ubuntu-latest
17+
defaults:
18+
run:
19+
working-directory: ./arona-core
20+
permissions:
21+
contents: write
22+
steps:
23+
- uses: actions/checkout@v4
24+
#安装使用jdk
25+
- name: Set up JDK 17
26+
uses: actions/setup-java@v4
27+
with:
28+
java-version: '17'
29+
distribution: 'temurin'
30+
#构建核心模块
31+
- name: Build with Gradle
32+
uses: gradle/gradle-build-action@v3
33+
with:
34+
build-root-directory: ./arona-core
35+
arguments: :buildPlugin
36+
#取文件名
37+
- name: Get Plugin Name
38+
run: |
39+
echo "NAME=$(find build/mirai -name "*2.jar" -exec sh -c 'basename {} | sed "s/\.jar$//"' \;)" >> $GITHUB_ENV
40+
echo "PATH=$(find build/mirai -name "*2.jar" -exec readlink -f {} +)" >> $GITHUB_ENV
41+
42+
#上传工件
43+
- name: Upload-Artifact
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: ${{ env.NAME }}
47+
path: ${{ env.PATH }}
48+
compression-level: 0
49+
#自动发布
50+
- name: Publish Release
51+
uses: ncipollo/release-action@v1
52+
with:
53+
artifacts: "${{ env.PATH }}"
54+
prerelease: ${{ contains(github.ref, 'pre') }}
55+
token: ${{ secrets.GITHUB_TOKEN }}
56+
allowUpdates: true

arona-core/build.gradle.kts

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
plugins {
22
val kotlinVersion = "1.7.10"
3-
val miraiVersion = "2.13.4"
3+
val miraiVersion = "2.16.0"
44
kotlin("jvm") version kotlinVersion
55
kotlin("plugin.serialization") version kotlinVersion
6-
6+
id("com.github.gmazzo.buildconfig") version "4.1.1"
77
id("net.mamoe.mirai-console") version miraiVersion
88
}
99

1010
group = "net.diyigemt"
11-
version = "1.1.4"
11+
version = "1.1.5"
1212
val exposedVersion = "0.38.2"
1313
val sqliteVersion = "3.36.0.3"
1414
val quartzVersion = "2.3.2"
@@ -19,8 +19,26 @@ repositories {
1919
maven("https://jitpack.io")
2020
maven("https://maven.aliyun.com/repository/public") // 阿里云国内代理仓库
2121
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
22+
//Overflow依赖仓库
23+
maven("https://s01.oss.sonatype.org/content/repositories/snapshots")
24+
}
25+
//Overflow测试需移除mirai-core
26+
mirai {
27+
noTestCore = true
28+
setupConsoleTestRuntime {
29+
// 移除 mirai-core 依赖
30+
classpath = classpath.filter {
31+
!it.nameWithoutExtension.startsWith("mirai-core-jvm")
32+
}
33+
}
34+
}
35+
buildConfig {
36+
className("BuildConfig")
37+
packageName("net.diyigemt.arona.cg")
38+
buildConfigField("String", "version", "\"${version}\"")
39+
buildConfigField("String", "name", "\"blue-archive-arona\"")
40+
buildConfigField("String", "id", "\"net.diyigemt.arona\"")
2241
}
23-
2442
dependencies {
2543
// implementation("com.github.kittinunf.fuel:fuel:2.3.1")
2644
implementation("org.jsoup:jsoup:1.15.1")
@@ -42,6 +60,8 @@ dependencies {
4260
// https://mvnrepository.com/artifact/com.github.taptap/pinyin-plus
4361
implementation("com.github.taptap:pinyin-plus:1.0")
4462
implementation("net.mamoe.yamlkt:yamlkt-jvm:0.10.2")
63+
//Overflow运行时依赖
64+
testConsoleRuntime("top.mrxiaom.mirai:overflow-core:1.0.4.589-05fbc9f-SNAPSHOT")
4565
}
4666

4767
tasks.test {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

arona-core/src/main/kotlin/net/diyigemt/arona/Arona.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ package net.diyigemt.arona
1010

1111
import kotlinx.coroutines.async
1212
import kotlinx.coroutines.launch
13+
import net.diyigemt.arona.cg.BuildConfig
1314
import net.diyigemt.arona.config.*
1415
import net.diyigemt.arona.db.DataBaseProvider
1516
import net.diyigemt.arona.extension.CommandInterceptorManager
@@ -49,9 +50,9 @@ import kotlin.io.path.absolutePathString
4950

5051
object Arona : KotlinPlugin(
5152
JvmPluginDescription(
52-
id = "net.diyigemt.arona",
53-
name = "blue-archive-arona",
54-
version = "1.1.4"
53+
id = BuildConfig.id,
54+
name = BuildConfig.name,
55+
version = BuildConfig.version
5556
) {
5657
author("diyigemt")
5758
info("是常驻这个「シッテムの箱」的系统管理员和主操作系统, 也是今后协助老师的秘书!")
@@ -124,7 +125,7 @@ object Arona : KotlinPlugin(
124125
INIT.forEach {
125126
it.init()
126127
}
127-
NetworkUtil.registerInstance()
128+
128129
}
129130
// startUpload() // 上传图片获取mirai-code
130131
}

arona-core/src/main/kotlin/net/diyigemt/arona/entity/GameKeeDAO.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ data class Data(
2020
val begin_at : Long,
2121
val end_at : Long,
2222
val importance : Int,
23-
val count_down : Int
23+
val count_down : Int,
24+
val pub_area : String
2425
)
2526

2627
data class Meta(

arona-core/src/main/kotlin/net/diyigemt/arona/util/GameKeeUtil.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import java.util.*
1313
*@Create 2022/7/21
1414
*/
1515
object GameKeeUtil {
16-
private const val url = "https://ba.gamekee.com/v1/activity/query"
16+
private const val url = "https://www.gamekee.com/v1/activity/query"
1717
fun getEventData(server: ServerLocale) : Pair<MutableList<Activity>, MutableList<Activity>>{
1818
val res = NetworkUtil.request(Jsoup.connect(url))
1919
.header("game-alias", "ba")
@@ -38,7 +38,7 @@ object GameKeeUtil {
3838
}
3939

4040
for(i in json.data){
41-
if(i.title.contains(server.serverName)){
41+
if(i.pub_area == server.serverName){
4242
method.call(
4343
Calendar.getInstance().time,
4444
Date(i.begin_at * 1000),

arona-core/src/main/kotlin/net/diyigemt/arona/util/NetworkUtil.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ object NetworkUtil {
3030

3131

3232
// 向后端服务器注册自己
33+
@Deprecated("放弃的方法")
3334
fun registerInstance() {
3435
val sysSave = SysDataUtil.get(SysStatic.UUID)
3536
if (sysSave == null) {

0 commit comments

Comments
 (0)