Skip to content
This repository was archived by the owner on Feb 11, 2025. It is now read-only.

Commit 7fd72e9

Browse files
committed
build(publish): 添加模组发布配置和流程
- 在 build.gradle 中添加 modpublisher 插件配置 - 新增 CHANGELOG.md 文件记录变更日志 - 在 gradle.properties 中添加 CurseForge 和 Modrinth 的模组 ID - 更新 README.md 中的模组名称链接 - 添加 GitHub Actions 工作流文件 release.yml,用于发布模组
1 parent c4b1d2e commit 7fd72e9

File tree

6 files changed

+70
-1
lines changed

6 files changed

+70
-1
lines changed

.github/workflows/release.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Publish Release
2+
3+
on:
4+
workflow_dispatch:
5+
release:
6+
types:
7+
- published
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
Build:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: Set up JDK 21
19+
uses: actions/setup-java@v4
20+
with:
21+
distribution: 'adopt'
22+
java-version: 21
23+
- name: Cache
24+
uses: actions/cache@v4
25+
with:
26+
path: |
27+
~/.gradle/caches
28+
~/.gradle/wrapper
29+
.gradle
30+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', 'build.gradle') }}
31+
- uses: gradle/actions/wrapper-validation@v3
32+
- name: Publish mod
33+
run: |
34+
chmod +x gradlew
35+
./gradlew publishMod --stacktrace -Porg.gradle.parallel.threads=4
36+
env:
37+
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
## Changelog
2+
- first version

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<img height="120" src="src/main/resources/icon.png" width="120"/>
22

33
# Checklist Localizer
4-
Make Checklist Mod support task localization!
4+
Make [Checklist](https://www.curseforge.com/minecraft/mc-mods/checklist) Mod support task localization!
55

66
### You can localize it in the following ways:
77

build.gradle

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
plugins {
22
id 'dev.architectury.loom' version '1.7-SNAPSHOT'
3+
id "com.hypherionmc.modutils.modpublisher" version "2.+"
34
id 'maven-publish'
45
}
56

@@ -65,3 +66,26 @@ publishing {
6566
// retrieving dependencies.
6667
}
6768
}
69+
70+
publisher {
71+
apiKeys {
72+
curseforge = System.getenv("CURSEFORGE_TOKEN")
73+
modrinth = System.getenv("MODRINTH_TOKEN")
74+
}
75+
76+
curseID = project.curseforge_id
77+
modrinthID = project.modrinth_id
78+
versionType = "release"
79+
changelog = file("CHANGELOG.md").getText('UTF-8')
80+
version = "$project.version"
81+
displayName = "ChecklistLocalizer-$project.version"
82+
gameVersions = ["1.20.1"]
83+
curseEnvironment = "client"
84+
loaders = ["forge"]
85+
artifact = remapJar
86+
addAdditionalFile(sourcesJar)
87+
88+
curseDepends {
89+
required "checklist"
90+
}
91+
}

gradle.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ mod_version = 0.1.0
77
maven_group = org.localizedmc.checklistlocalizer
88
archives_name = ChecklistLocalizer
99

10+
curseforge_id=1174754
11+
modrinth_id=fSVdpac3
12+
1013
# Minecraft properties
1114
minecraft_version = 1.20.1
1215
yarn_mappings = 1.20.1+build.10

settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ pluginManagement {
33
maven { url "https://maven.fabricmc.net/" }
44
maven { url "https://maven.architectury.dev/" }
55
maven { url "https://files.minecraftforge.net/maven/" }
6+
maven { url "https://maven.firstdarkdev.xyz/releases" }
67
gradlePluginPortal()
78
}
89
}

0 commit comments

Comments
 (0)