fix: use update domain for hot bundle urls
This commit is contained in:
@@ -39,7 +39,9 @@ if (!token) {
|
||||
if (!token) { console.error("缺少 gitea token:设置 GIT_TOKEN 或写入 ~/.tokendun-git-token"); process.exit(1); }
|
||||
|
||||
const OWNER = "mhgmh", REPO = "codex-market-app", TAG = "hot";
|
||||
const API = `https://update.tokendun.cc/api/v1/repos/${OWNER}/${REPO}`;
|
||||
// Authenticated writes go through the direct upstream host; public download
|
||||
// URLs must use update.tokendun.cc because that is what clients/users read.
|
||||
const API = `https://up.tokendun.cc/api/v1/repos/${OWNER}/${REPO}`;
|
||||
const DL = `https://update.tokendun.cc/${OWNER}/${REPO}/releases/download/${TAG}`;
|
||||
|
||||
const OUT = path.join(ROOT, "dist-hot");
|
||||
@@ -115,6 +117,10 @@ function upload(file, name) {
|
||||
"-F", `attachment=@${file};type=application/octet-stream`,
|
||||
`${API}/releases/${rel.id}/assets?name=${encodeURIComponent(name)}`], { encoding: "utf8" });
|
||||
console.log(`上传 ${name} → HTTP ${code}`);
|
||||
if (code !== "201") {
|
||||
console.error(`上传 ${name} 失败,HTTP ${code}`);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
upload(bundlePath, bundleName);
|
||||
upload(manifestPath, "hotupdate.json");
|
||||
|
||||
Reference in New Issue
Block a user