mirror of
https://github.com/Pridecraft-Studios/joy.git
synced 2025-08-03 06:26:00 -04:00
fix: Actions
Reusable workflows my ass
This commit is contained in:
parent
dfd5b7ad55
commit
9a8ab18fa2
2
.github/workflows/publish.yml
vendored
2
.github/workflows/publish.yml
vendored
@ -10,7 +10,7 @@ permissions:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
uses: Modflower/workflows/.github/workflows/mod-publish.yml@main
|
uses: Pridecraft-Studios/workflows/.github/workflows/mod-publish.yml@main
|
||||||
with:
|
with:
|
||||||
artifacts: |
|
artifacts: |
|
||||||
*/build/libs/*
|
*/build/libs/*
|
||||||
|
@ -40,7 +40,7 @@ public class BuildPlugin implements Plugin<Project> {
|
|||||||
version,
|
version,
|
||||||
Util.mkVersion(version + "+mc." + minecraftVersion),
|
Util.mkVersion(version + "+mc." + minecraftVersion),
|
||||||
Util.getVersionType(version),
|
Util.getVersionType(version),
|
||||||
Util.mkChangelog(Properties.str(target, "github")),
|
Util.mkChangelog(Properties.str(target, "github"), Properties.str(target, "forge")),
|
||||||
Util.getCompatibleVersions(libs, target)
|
Util.getCompatibleVersions(libs, target)
|
||||||
));
|
));
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ public final class Properties {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static @Nullable String str(Project project, String property) {
|
public static @Nullable String str(Project project, String property) {
|
||||||
final var p = project.property(property);
|
final var p = project.findProperty(property);
|
||||||
if (p == null) {
|
if (p == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ public class Util {
|
|||||||
return URLEncoder.encode(str, StandardCharsets.UTF_8);
|
return URLEncoder.encode(str, StandardCharsets.UTF_8);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String mkChangelog(String git) {
|
public static String mkChangelog(String git, String forge) {
|
||||||
if (!isBlank(Env.Changelog)) {
|
if (!isBlank(Env.Changelog)) {
|
||||||
logger.debug("Changelog found, returning {}", Env.Changelog);
|
logger.debug("Changelog found, returning {}", Env.Changelog);
|
||||||
return Env.Changelog;
|
return Env.Changelog;
|
||||||
@ -35,8 +35,10 @@ public class Util {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (startsWith(Env.Reference, "refs/tags/")) {
|
final var host = VcsHost.find(git, forge);
|
||||||
final var host = VcsHost.find(git);
|
if (host == null) {
|
||||||
|
logger.warn("Forge not found. Returning bare link to {}", git);
|
||||||
|
} else if (startsWith(Env.Reference, "refs/tags/")) {
|
||||||
|
|
||||||
logger.warn("Changelog not found but tag reference was, returning link to {}{}{}",
|
logger.warn("Changelog not found but tag reference was, returning link to {}{}{}",
|
||||||
git, host.release, urlEncode(Env.getTag()));
|
git, host.release, urlEncode(Env.getTag()));
|
||||||
|
@ -17,7 +17,7 @@ public enum VcsHost {
|
|||||||
this.release = release;
|
this.release = release;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static VcsHost find(String url) {
|
public static VcsHost find(String url, String forge) {
|
||||||
// "https://".length = 8
|
// "https://".length = 8
|
||||||
final int lastSlash = url.indexOf('/', 8);
|
final int lastSlash = url.indexOf('/', 8);
|
||||||
for (final var host : values()) {
|
for (final var host : values()) {
|
||||||
@ -28,6 +28,11 @@ public enum VcsHost {
|
|||||||
return host;
|
return host;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for (final var host : values()) {
|
||||||
|
if (host.name().equals(forge)) {
|
||||||
|
return host;
|
||||||
|
}
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user