Skip to content

Commit c15dbc5

Browse files
committed
Auto Publishing
1 parent 681d751 commit c15dbc5

File tree

3 files changed

+113
-1
lines changed

3 files changed

+113
-1
lines changed

Diff for: .env

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
MODRINTH_PUBLISH_TOKEN=mrp_V6ysVsWcaMCPugrHg5GUob2Uf70dtgzHWVNCt5MPvcvB7fTuyIPNJq2113yC
2+
CURSEFORGE_PUBLISH_TOKEN=cebc739a-b102-4e8f-8642-31ddbf201d78
3+
DISCORD_WEBHOOK=https://discord.com/api/webhooks/1272505641046642761/PBHgIyMaVC30Ao3ar4kGByyT6xck45god-L3z53HbhXda7x4k4pE3y0okBVlJu3v4NQR

Diff for: build.gradle

+98-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
1-
plugins {
1+
import org.yaml.snakeyaml.Yaml
2+
3+
buildscript {
4+
repositories {
5+
mavenCentral()
6+
}
7+
dependencies {
8+
classpath group: 'org.yaml', name: 'snakeyaml', version: '1.19'
9+
}
10+
}
11+
12+
13+
plugins {
214
id "architectury-plugin" version "3.4-SNAPSHOT"
315
id "dev.architectury.loom" version "1.5-SNAPSHOT" apply false
416
id "io.github.p03w.machete" version "1.+" // automatic jar compressing on build
17+
id "me.modmuss50.mod-publish-plugin" version "0.6.3"
518
}
619

720
architectury {
@@ -77,3 +90,87 @@ allprojects {
7790
enabled = buildNumber != null
7891
}
7992
}
93+
94+
95+
publishMods {
96+
def TOKENS = new HashMap<String, String>();
97+
file("$projectDir/.env").readLines().each() {
98+
def (key, value) = it.tokenize('=')
99+
TOKENS.put(key, value)
100+
}
101+
102+
def cfg = new Yaml().load(new File("$projectDir/changelog.yaml").newInputStream())
103+
def changelogText = cfg[minecraft_version + "-" + mod_version];
104+
println("Found Changelog: \n" + changelogText)
105+
106+
def forgeName = "Create: Pattern Schematics $mod_version Forge $minecraft_version";
107+
def fabricName = "Create: Pattern Schematics $mod_version Fabric $minecraft_version";
108+
109+
def forgeFile = project(":forge").tasks.named("remapJar").get().archiveFile;
110+
def fabricFile = project(":fabric").tasks.named("remapJar").get().archiveFile;
111+
112+
def forgeEmoji = "<:forge:1267784983771222088>";
113+
def fabricEmoji = "<:fabric:1267785013936783421>";
114+
def newVersionPing = "<@&1267779725040947243>";
115+
116+
changelog = "Changelog: \n" + changelogText
117+
type = STABLE
118+
119+
curseforge("forgeCF") {
120+
file = forgeFile
121+
displayName = forgeName
122+
projectId = "1072349"
123+
projectSlug = "create-pattern-schematics" // Required for discord webhook
124+
accessToken = TOKENS.get("CURSEFORGE_PUBLISH_TOKEN")
125+
minecraftVersions.add(minecraft_version)
126+
announcementTitle = "Curseforge download for $forgeEmoji"
127+
modLoaders.add("forge")
128+
129+
javaVersions.add(JavaVersion.VERSION_17)
130+
clientRequired = true
131+
serverRequired = true
132+
requires("create")
133+
}
134+
modrinth("forgeMR") {
135+
file = forgeFile
136+
displayName = forgeName
137+
projectId = "cpqKG67r"
138+
accessToken = TOKENS.get("MODRINTH_PUBLISH_TOKEN")
139+
minecraftVersions.add(minecraft_version)
140+
announcementTitle = "Modrinth download for $forgeEmoji"
141+
modLoaders.add("forge")
142+
requires("create")
143+
}
144+
145+
curseforge("fabricCF") {
146+
file = fabricFile
147+
displayName = fabricName
148+
projectId = "1072349"
149+
projectSlug = "create-pattern-schematics" // Required for discord webhook
150+
accessToken = TOKENS.get("CURSEFORGE_PUBLISH_TOKEN")
151+
minecraftVersions.add(minecraft_version)
152+
announcementTitle = "Curseforge download for $fabricEmoji"
153+
modLoaders.add("fabric")
154+
155+
javaVersions.add(JavaVersion.VERSION_17)
156+
clientRequired = true
157+
serverRequired = true
158+
requires("create-fabric", "fabric-api")
159+
}
160+
modrinth("fabricMR") {
161+
file = fabricFile
162+
displayName = fabricName
163+
projectId = "cpqKG67r"
164+
accessToken = TOKENS.get("MODRINTH_PUBLISH_TOKEN")
165+
minecraftVersions.add(minecraft_version)
166+
announcementTitle = "Modrinth download for $fabricEmoji"
167+
modLoaders.add("fabric")
168+
requires("create-fabric", "fabric-api")
169+
}
170+
171+
discord("discordUniversal") {
172+
webhookUrl = TOKENS.get("DISCORD_WEBHOOK")
173+
username = "New Version Announcement | Create: Pattern Schematics"
174+
content = "$newVersionPing\n# Create: Pattern Schematics has been updated to $mod_version for $minecraft_version ($fabricEmoji / $forgeEmoji)\n " + changelogText
175+
}
176+
}

Diff for: changelog.yaml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
3+
1.19.2-1.1.8: |
4+
- Updated mod links in mods.toml and the fabric.mod.json
5+
- Forge now has the update checker configured
6+
- Fixed the copycats not displaying accurately in the ponder (after I failed to cover up my laziness thanks @d4rkfl4sh)
7+
- Added shift control to the clone tool to help with large schematics
8+
- Made the schematicannon result in the proper item (previously would give Create's schematic no matter what)
9+
- Added an indicator when applying a non positioned schematic to a contraption deployer
10+
(This is a port, so this is the list of all changes from version 1.1.6->1.1.8)
11+
12+
...

0 commit comments

Comments
 (0)