Compare commits

...
Author SHA1 Message Date
layue13 141df8c7b8 ci: delete the old generic package file right before re-uploading it (#21)
Publish TDLM launcher / publish (push) Skipped
Mirror Repository / Mirror to CNB (push) Skipped
Mirror Repository / Mirror to Gitee (push) Skipped
Publish TDLM launcher / noop (push) Successful in 2s
Java CI / build (push) Successful in 8m10s
Co-authored-by: Layue13 <layue13@icloud.com>
2026-11-10 08:46:54 +00:00
layue13 f5d739711d fix: default client fileApi is the Nexus raw tdlm-client (#20)
Mirror Repository / Mirror to CNB (push) Skipped
Mirror Repository / Mirror to Gitee (push) Skipped
Java CI / build (push) Successful in 8m14s
Co-authored-by: Layue13 <layue13@icloud.com>
2026-11-10 08:28:39 +00:00
3 changed files with 23 additions and 2 deletions

No files matched your search

+11
View File
@@ -138,6 +138,17 @@ jobs:
def put(name: str, data: bytes):
url = upload_root + "/" + urllib.parse.quote(name, safe="")
# Gitea refuses to overwrite a generic package file (HTTP 409), so the previous copy of this one
# file is deleted right before it is uploaded again (keeps the gap without a file as short as possible).
delete = urllib.request.Request(url, method="DELETE")
delete.add_header("Authorization", "token " + token)
delete.add_header("User-Agent", "tdlm-hmcl-publish")
try:
with urllib.request.urlopen(delete, timeout=300) as response:
response.read()
except urllib.error.HTTPError as exc:
if exc.code != 404:
raise SystemExit("HTTP %s deleting the old %s: %s" % (exc.code, name, exc.read()[:300]))
request = urllib.request.Request(url, data=data, method="PUT")
request.add_header("Authorization", "token " + token)
request.add_header("Content-Type", "application/octet-stream")
@@ -141,9 +141,9 @@ public final class Metadata {
return null;
}
/// Default client Server Modpack fileApi (CDN mirror of Pack's `tdlm-client/latest` layout).
/// Default client Server Modpack fileApi: the Nexus raw repository `tdlm-client` read through the CDN host.
public static final String DEFAULT_CLIENT_FILE_API =
"https://packages.dandanton.com/tdlm-client/latest";
"https://maven.dandanton.com/repository/tdlm-client";
/// Stable client update root (`server-manifest.json` and `overrides/` live under this URL).
///
@@ -398,12 +398,22 @@ public final class Controllers {
.whenComplete(Schedulers.javafx(), (result, exception) -> {
if (exception != null) {
LOG.warning("Failed to fetch client Server Modpack manifest", exception);
Controllers.dialog(
manifestUrl + "\n" + exception.getMessage(),
i18n("message.error"),
MessageType.ERROR);
Instances.importModpack();
return;
}
ServerModpackManifest manifest =
JsonUtils.fromMaybeMalformedJson(result, ServerModpackManifest.class);
if (manifest == null) {
LOG.warning("Malformed client Server Modpack manifest from " + manifestUrl);
Controllers.dialog(
i18n("modpack.type.server.malformed"),
i18n("message.error"),
MessageType.ERROR);
Instances.importModpack();
return;
}
Controllers.getDecorator().startWizard(