mirror of
https://github.com/Pridecraft-Studios/joy.git
synced 2025-08-02 22:15:58 -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:
|
||||
build:
|
||||
uses: Modflower/workflows/.github/workflows/mod-publish.yml@main
|
||||
uses: Pridecraft-Studios/workflows/.github/workflows/mod-publish.yml@main
|
||||
with:
|
||||
artifacts: |
|
||||
*/build/libs/*
|
||||
|
@ -40,7 +40,7 @@ public class BuildPlugin implements Plugin<Project> {
|
||||
version,
|
||||
Util.mkVersion(version + "+mc." + minecraftVersion),
|
||||
Util.getVersionType(version),
|
||||
Util.mkChangelog(Properties.str(target, "github")),
|
||||
Util.mkChangelog(Properties.str(target, "github"), Properties.str(target, "forge")),
|
||||
Util.getCompatibleVersions(libs, target)
|
||||
));
|
||||
|
||||
|
@ -22,7 +22,7 @@ public final class Properties {
|
||||
}
|
||||
|
||||
public static @Nullable String str(Project project, String property) {
|
||||
final var p = project.property(property);
|
||||
final var p = project.findProperty(property);
|
||||
if (p == null) {
|
||||
return null;
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ public class Util {
|
||||
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)) {
|
||||
logger.debug("Changelog found, returning {}", Env.Changelog);
|
||||
return Env.Changelog;
|
||||
@ -35,8 +35,10 @@ public class Util {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (startsWith(Env.Reference, "refs/tags/")) {
|
||||
final var host = VcsHost.find(git);
|
||||
final var host = VcsHost.find(git, forge);
|
||||
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 {}{}{}",
|
||||
git, host.release, urlEncode(Env.getTag()));
|
||||
|
@ -17,7 +17,7 @@ public enum VcsHost {
|
||||
this.release = release;
|
||||
}
|
||||
|
||||
public static VcsHost find(String url) {
|
||||
public static VcsHost find(String url, String forge) {
|
||||
// "https://".length = 8
|
||||
final int lastSlash = url.indexOf('/', 8);
|
||||
for (final var host : values()) {
|
||||
@ -28,6 +28,11 @@ public enum VcsHost {
|
||||
return host;
|
||||
}
|
||||
}
|
||||
for (final var host : values()) {
|
||||
if (host.name().equals(forge)) {
|
||||
return host;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user