Skip to content

Commit 9a8ab18

Browse files
committed
fix: Actions
Reusable workflows my ass
1 parent dfd5b7a commit 9a8ab18

File tree

5 files changed

+14
-7
lines changed

5 files changed

+14
-7
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ permissions:
1010

1111
jobs:
1212
build:
13-
uses: Modflower/workflows/.github/workflows/mod-publish.yml@main
13+
uses: Pridecraft-Studios/workflows/.github/workflows/mod-publish.yml@main
1414
with:
1515
artifacts: |
1616
*/build/libs/*

buildSrc/src/main/java/gay/ampflower/BuildPlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public void apply(final Project target) {
4040
version,
4141
Util.mkVersion(version + "+mc." + minecraftVersion),
4242
Util.getVersionType(version),
43-
Util.mkChangelog(Properties.str(target, "github")),
43+
Util.mkChangelog(Properties.str(target, "github"), Properties.str(target, "forge")),
4444
Util.getCompatibleVersions(libs, target)
4545
));
4646

buildSrc/src/main/java/gay/ampflower/internal/Properties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public static boolean bool(Project project, String property) {
2222
}
2323

2424
public static @Nullable String str(Project project, String property) {
25-
final var p = project.property(property);
25+
final var p = project.findProperty(property);
2626
if (p == null) {
2727
return null;
2828
}

buildSrc/src/main/java/gay/ampflower/internal/Util.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public static String urlEncode(String str) {
2424
return URLEncoder.encode(str, StandardCharsets.UTF_8);
2525
}
2626

27-
public static String mkChangelog(String git) {
27+
public static String mkChangelog(String git, String forge) {
2828
if (!isBlank(Env.Changelog)) {
2929
logger.debug("Changelog found, returning {}", Env.Changelog);
3030
return Env.Changelog;
@@ -35,8 +35,10 @@ public static String mkChangelog(String git) {
3535
return null;
3636
}
3737

38-
if (startsWith(Env.Reference, "refs/tags/")) {
39-
final var host = VcsHost.find(git);
38+
final var host = VcsHost.find(git, forge);
39+
if (host == null) {
40+
logger.warn("Forge not found. Returning bare link to {}", git);
41+
} else if (startsWith(Env.Reference, "refs/tags/")) {
4042

4143
logger.warn("Changelog not found but tag reference was, returning link to {}{}{}",
4244
git, host.release, urlEncode(Env.getTag()));

buildSrc/src/main/java/gay/ampflower/internal/VcsHost.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public enum VcsHost {
1717
this.release = release;
1818
}
1919

20-
public static VcsHost find(String url) {
20+
public static VcsHost find(String url, String forge) {
2121
// "https://".length = 8
2222
final int lastSlash = url.indexOf('/', 8);
2323
for (final var host : values()) {
@@ -28,6 +28,11 @@ public static VcsHost find(String url) {
2828
return host;
2929
}
3030
}
31+
for (final var host : values()) {
32+
if (host.name().equals(forge)) {
33+
return host;
34+
}
35+
}
3136
return null;
3237
}
3338
}

0 commit comments

Comments
 (0)