Skip to content

Commit 78d5ce8

Browse files
committed
chore: update workflows
1 parent 917a95f commit 78d5ce8

5 files changed

Lines changed: 18 additions & 6 deletions

File tree

.github/workflows/pr-test.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,5 @@ jobs:
2222
- name: Grant execute permission for gradlew
2323
run: chmod +x gradlew
2424

25-
- name: Build with Gradle
25+
- name: Test build
2626
run: ./gradlew build --stacktrace
27-
28-
- name: Run Tests
29-
run: ./gradlew test --stacktrace

.github/workflows/publish.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
MODRINTH_API_TOKEN: ${{ secrets.MODRINTH_API_TOKEN }}
1717
BUILD_NUMBER: ${{ github.run_number }}
1818
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
19+
COMMIT_HASH: ${{ github.sha }}
1920
steps:
2021
- uses: actions/checkout@v6
2122
- name: Set up JDK 25

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ hangarPublish {
5151
version = project.version as String
5252
id = "BetterModel"
5353
apiKey = System.getenv("HANGAR_API_TOKEN")
54-
val log = System.getenv("COMMIT_MESSAGE")
54+
val log = commitMessage()
5555
if (log != null) {
5656
changelog = log
5757
channel = "Snapshot"

buildSrc/src/main/kotlin/Extensions.kt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,19 @@ val SUPPORTED_VERSIONS = buildList {
2727
addAll(LATEST_VERSION)
2828
}
2929

30+
fun commitMessage() = System.getenv("COMMIT_MESSAGE")?.let {
31+
"""
32+
**Commit hash**: ${System.getenv("COMMIT_HASH")?.let { hash -> "[$hash](https://github.com/toxicity188/BetterModel/commit/$hash) "} ?: "Unknown"}
33+
34+
---
35+
36+
$it
37+
38+
---
39+
40+
**Notice**: This is a snapshot build provided strictly for **testing purposes**. As a development version, unexpected issues or bugs may occur during use.
41+
""".trimIndent()
42+
}
43+
3044
val BUKKIT_LOADERS = listOf("spigot")
3145
val PAPER_LOADERS = listOf("paper", "purpur", "folia")

buildSrc/src/main/kotlin/modrinth-conventions.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ modrinth {
1111
token = System.getenv("MODRINTH_API_TOKEN")
1212
projectId = "bettermodel"
1313
syncBodyFrom = rootProject.file("BANNER.md").readText()
14-
val log = System.getenv("COMMIT_MESSAGE")
14+
val log = commitMessage()
1515
if (log != null) {
1616
versionType = "beta"
1717
changelog = log

0 commit comments

Comments
 (0)