Skip to content

Commit e59a4ae

Browse files
committed
尝试更新发布和CI配置
1 parent 333f5dd commit e59a4ae

File tree

7 files changed

+30
-35
lines changed

7 files changed

+30
-35
lines changed

.github/workflows/publish-v4-release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
java-version: ${{ env.JAVA_VERSION }}
3232
cache: 'gradle'
3333
- name: Run All Tests pre release
34-
uses: gradle/gradle-build-action@v3
34+
uses: gradle/actions/setup-gradle@v3
3535
with:
3636
gradle-version: ${{ env.GRADLE_VERSION }}
3737

@@ -59,7 +59,7 @@ jobs:
5959

6060
# setup Gradle
6161
- name: Gradle Publish Release
62-
uses: gradle/gradle-build-action@v3
62+
uses: gradle/actions/setup-gradle@v3
6363
with:
6464
gradle-version: ${{ env.GRADLE_VERSION }}
6565
arguments: |
@@ -89,7 +89,7 @@ jobs:
8989

9090
# setup Gradle
9191
- name: Gradle publish snapshot
92-
uses: gradle/gradle-build-action@v3
92+
uses: gradle/actions/setup-gradle@v3
9393
with:
9494
gradle-version: ${{ env.GRADLE_VERSION }}
9595
arguments: |
@@ -122,7 +122,7 @@ jobs:
122122

123123
# setup Gradle
124124
- name: Gradle generate documentation
125-
uses: gradle/gradle-build-action@v3
125+
uses: gradle/actions/setup-gradle@v3
126126
with:
127127
gradle-version: ${{ env.GRADLE_VERSION }}
128128
arguments: |

.github/workflows/publish-v4-snapshot.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,10 @@ jobs:
9595
--warning-mode all
9696
-x test
9797
-Porg.gradle.jvmargs="-Xms4G -XX:MaxMetaspaceSize=1G -Dfile.encoding=UTF-8"
98+
env:
99+
SIMBOT_IS_SNAPSHOT: true
98100

99-
# parallel=true 容易出现 Metaspace 的异常? 去了试试
101+
# parallel=true 容易出现 Metaspace 的异常? 去了试试
100102

101103
deploy-doc:
102104
name: Deploy snapshots API doc
@@ -120,7 +122,7 @@ jobs:
120122

121123
# setup Gradle
122124
- name: Gradle generate documentation
123-
uses: gradle/gradle-build-action@v3
125+
uses: gradle/actions/setup-gradle@v3
124126
with:
125127
gradle-version: ${{ env.GRADLE_VERSION }}
126128
arguments: |

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ val root = project
5858

5959
allprojects {
6060
group = P.GROUP
61-
version = P.VERSION
61+
version = if (isSnapshot()) P.NEXT_SNAPSHOT_VERSION else P.VERSION
6262
description = P.DESCRIPTION
6363
}
6464

buildSrc/src/main/kotlin/P.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ sealed class P(override val group: String) : ProjectDetail() {
5353
*/
5454
companion object {
5555
const val VERSION = "4.1.1"
56+
const val SNAPSHOT_VERSION = "$VERSION-SNAPSHOT"
5657
const val NEXT_VERSION = "4.1.1"
58+
const val NEXT_SNAPSHOT_VERSION = "$NEXT_VERSION-SNAPSHOT"
5759

5860
const val GROUP = "love.forte.simbot"
5961
const val GROUP_COMMON = "love.forte.simbot.common"

buildSrc/src/main/kotlin/simbot-multiplatform-maven-publish.gradle.kts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,6 @@ publishing {
7777
artifact(jarJavadoc)
7878
}
7979

80-
if (isSnapshot) {
81-
version = P.NEXT_VERSION + "-SNAPSHOT"
82-
}
83-
8480
setupPom(project.name, P.Simbot)
8581
pom {
8682
issueManagement {

buildSrc/src/main/kotlin/simbot.nexus-publish.gradle.kts

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,6 @@ import love.forte.gradle.common.publication.configure.nexusPublishConfig
2727
import utils.checkPublishConfigurable
2828
import java.time.Duration
2929

30-
/*
31-
* Copyright (c) 2022 ForteScarlet <[email protected]>
32-
*
33-
* 本文件是 simbot-component-kaiheila 的一部分。
34-
*
35-
* simbot-component-kaiheila 是自由软件:你可以再分发之和/或依照由自由软件基金会发布的 GNU 通用公共许可证修改之,无论是版本 3 许可证,还是(按你的决定)任何以后版都可以。
36-
*
37-
* 发布 simbot-component-kaiheila 是希望它能有用,但是并无保障;甚至连可销售和符合某个特定的目的都不保证。请参看 GNU 通用公共许可证,了解详情。
38-
*
39-
* 你应该随程序获得一份 GNU 通用公共许可证的复本。如果没有,请看:
40-
* https://www.gnu.org/licenses
41-
* https://www.gnu.org/licenses/gpl-3.0-standalone.html
42-
* https://www.gnu.org/licenses/lgpl-3.0-standalone.html
43-
*
44-
*
45-
*/
46-
4730
plugins {
4831
id("io.github.gradle-nexus.publish-plugin")
4932
}
@@ -68,7 +51,7 @@ nexusPublishConfig {
6851
transitionCheckDelayBetween = Duration.ofSeconds(15)
6952

7053
projectDetail = P.Simbot
71-
useStaging = project.provider { !project.version.toString().endsWith("SNAPSHOT", ignoreCase = true) }
54+
useStaging = project.provider { !project.version.toString().contains("SNAPSHOT", ignoreCase = true) }
7255
repositoriesConfig = {
7356
sonatype {
7457
snapshotRepositoryUrl.set(uri(Repositories.Snapshot.URL))

buildSrc/src/main/kotlin/utils/PublishConfigurableUtil.kt

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,29 @@
11
/*
2-
* Copyright (c) 2022-2023 ForteScarlet.
2+
* Copyright (c) 2022-2024. ForteScarlet.
33
*
4-
* This file is part of Simple Robot.
4+
* Project https://github.com/simple-robot/simpler-robot
5+
56
*
6-
* Simple Robot is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
7+
* This file is part of the Simple Robot Library (Alias: simple-robot, simbot, etc.).
78
*
8-
* Simple Robot is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
9+
* This program is free software: you can redistribute it and/or modify
10+
* it under the terms of the GNU Lesser General Public License as published by
11+
* the Free Software Foundation, either version 3 of the License, or
12+
* (at your option) any later version.
13+
*
14+
* This program is distributed in the hope that it will be useful,
15+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
* Lesser GNU General Public License for more details.
18+
*
19+
* You should have received a copy of the Lesser GNU General Public License
20+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
921
*
10-
* You should have received a copy of the GNU Lesser General Public License along with Simple Robot. If not, see <https://www.gnu.org/licenses/>.
1122
*/
1223

1324
package utils
1425

26+
import Env
1527
import isSnapshot
1628

1729
data class PublishConfigurableResult(
@@ -30,7 +42,7 @@ fun checkPublishConfigurable(): PublishConfigurableResult {
3042
(System.getProperty("snapshotOnly") ?: System.getenv(Env.SNAPSHOT_ONLY))?.equals("true", true) == true
3143
val isReleaseOnly =
3244
(System.getProperty("releaseOnly") ?: System.getenv(Env.RELEASES_ONLY))?.equals("true", true) == true
33-
45+
3446
return PublishConfigurableResult(isSnapshotOnly, isReleaseOnly)
3547
}
3648

0 commit comments

Comments
 (0)