feat: add china region game resource data

This commit is contained in:
daydreamer-json
2026-02-16 00:23:09 +09:00
parent c1a0aa69ff
commit d0e18b90d0
36 changed files with 6906 additions and 67 deletions

View File

@@ -10,11 +10,8 @@ async function uploadAsset(
targetFileName: string | null,
) {
if (!client || !authCfg) return;
const { data: release } = await client.rest.repos.getReleaseByTag({
owner: authCfg.owner,
repo: authCfg.repo,
tag: authCfg.tag,
});
const release = await getReleaseInfo(client, authCfg);
if (!release) throw new Error('GH release not found');
const releaseId = release.id;
logger.info(`Mirror archive: Downloading ${new URL(url).pathname.split('/').pop()} ...`);
@@ -32,6 +29,20 @@ async function uploadAsset(
});
}
async function getReleaseInfo(
client: Octokit | null,
authCfg: { token: string; owner: string; repo: string; tag: string } | null,
) {
if (!client || !authCfg) return;
const { data: release } = await client.rest.repos.getReleaseByTag({
owner: authCfg.owner,
repo: authCfg.repo,
tag: authCfg.tag,
});
return release;
}
export default {
uploadAsset,
getReleaseInfo,
};