Skip to content

Commit b118ccc

Browse files
authored
Merge pull request #412 from RedstoneTools/dev
Dev
2 parents 11eaf61 + 1939754 commit b118ccc

File tree

5 files changed

+71
-33
lines changed

5 files changed

+71
-33
lines changed

.github/workflows/publish.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
11
name: Publish Mod
2-
on: [workflow_dispatch] # Manual trigger
3-
2+
#on: [workflow_dispatch] # Manual trigger
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
release_github:
7+
type: boolean
8+
description: 'Github Release'
9+
default: false
10+
github_repo:
11+
type: string
12+
description: 'Github repo'
13+
default: "RedstoneTools/redstonetools-mod"
14+
release_modrinth:
15+
type: boolean
16+
description: 'Modrinth Release'
17+
default: false
418
permissions:
519
contents: write
620

@@ -16,4 +30,7 @@ jobs:
1630
env:
1731
# modrinth-id: 9ySQVrz2
1832
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19-
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
33+
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
34+
RELEASE_GITHUB: ${{ inputs.release_github }}
35+
RELEASE_MODRINTH: ${{ inputs.release_modrinth }}
36+
GITHUB_REPO: ${{ inputs.github_repo }}

build.gradle

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
plugins {
22
id 'fabric-loom' version '1.11-SNAPSHOT'
33
id 'maven-publish'
4-
id 'com.github.johnrengelman.shadow' version '8.+'
54
id "me.modmuss50.mod-publish-plugin" version "1.1.0"
65
}
76

@@ -178,38 +177,32 @@ publishing {
178177
}
179178
}
180179

181-
subprojects {
182-
publishMods {
183-
github {
184-
accessToken = providers.environmentVariable("GITHUB_TOKEN")
185-
parent project(":").tasks.named("publishGithub")
186-
}
187-
}
188-
}
189-
190180
publishMods {
191181
file = remapJar.archiveFile
192182
type = STABLE
193183
modLoaders.add("fabric")
194184

195-
changelog = ""
185+
changelog = ""
196186
displayName = "${project.mod_version}"
197187

198-
github {
199-
accessToken = providers.environmentVariable("GITHUB_TOKEN")
200-
repository = "RedstoneTools/redstonetools-mod"
201-
commitish = "main"
202-
tagName = "${project.mod_version}"
203-
allowEmptyFiles = true
204-
}
205-
206-
modrinth {
207-
accessToken = providers.environmentVariable("MODRINTH_TOKEN")
208-
projectId = "9ySQVrz2"
209-
minecraftVersions.add(project.minecraft_version)
210-
211-
requires("fabric-api")
212-
requires("malilib")
213-
optional("worldedit")
188+
if (providers.environmentVariable("RELEASE_MODRINTH").getOrElse("false").toBoolean()) {
189+
modrinth {
190+
accessToken = providers.environmentVariable("MODRINTH_TOKEN")
191+
projectId = "9ySQVrz2"
192+
minecraftVersions.add(project.minecraft_version)
193+
194+
requires("fabric-api")
195+
requires("malilib")
196+
optional("worldedit")
197+
}
198+
}
199+
200+
201+
if (providers.environmentVariable("RELEASE_GITHUB").getOrElse("false").toBoolean()) {
202+
github {
203+
accessToken = providers.environmentVariable("GITHUB_TOKEN")
204+
205+
parent rootProject.tasks.named("publishGithub")
206+
}
214207
}
215208
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ maven_group = tools.redstone
66
archives_base_name = redstonetools
77

88
loader_version=0.17.3
9-
mod_version = v3.1.4
9+
mod_version = v3.1.5

src/client/java/tools/redstone/redstonetools/malilib/widget/action/CommandListWidget.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public CommandListWidget(GuiMacroEditor parent, MinecraftClient mc, int width, i
2525
super(mc, width, height, y, itemHeight);
2626
this.parent = parent;
2727
this.macro = macro;
28-
this.macro.actions.forEach((t) -> this.children().add(new CommandEntry(t, this)));
28+
this.macro.actions.forEach((t) -> this.addEntry(new CommandEntry(t, this)));
2929
}
3030

3131
@Override

stonecutter.gradle

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,32 @@
11
plugins {
22
id "dev.kikugie.stonecutter"
3+
id "me.modmuss50.mod-publish-plugin" version "1.1.0"
34
}
4-
stonecutter.active "1.21.10"
5+
stonecutter.active "1.21.10"
6+
7+
version = project.mod_version + "+" + stonecutter.current.version
8+
9+
publishMods {
10+
if (providers.environmentVariable("RELEASE_MODRINTH").getOrElse("false").toBoolean()) {
11+
if (!providers.environmentVariable("MODRINTH_TOKEN").isPresent() || providers.environmentVariable("MODRINTH_TOKEN").get() == "") {
12+
throw new GradleException('Missing MODRINTH_TOKEN')
13+
}
14+
}
15+
16+
if (providers.environmentVariable("RELEASE_GITHUB").getOrElse("false").toBoolean()) {
17+
if (!providers.environmentVariable("GITHUB_TOKEN").isPresent() || providers.environmentVariable("GITHUB_TOKEN").get() == "") {
18+
throw new GradleException('Missing GITHUB_TOKEN')
19+
}
20+
21+
github {
22+
accessToken = providers.environmentVariable("GITHUB_TOKEN")
23+
repository = providers.environmentVariable("GITHUB_REPO")
24+
commitish = "main"
25+
changelog = ""
26+
type = STABLE
27+
tagName = "${project.mod_version}"
28+
displayName = "Redstone Tools ${rootProject.mod_version}"
29+
allowEmptyFiles = true
30+
}
31+
}
32+
}

0 commit comments

Comments
 (0)