💚 尝试调整CI

This commit is contained in:
BTMuli
2026-04-28 01:47:35 +08:00
parent 3d8f121339
commit 0ab8bf3c25
5 changed files with 787 additions and 774 deletions

View File

@@ -1,6 +1,6 @@
/**
* 本地构建脚本
* @since Beta v0.9.4
* @since Beta v0.10.1
*/
import { resolve } from "path";
import { fileURLToPath } from "node:url";
@@ -14,8 +14,10 @@ const __dirname = resolve(fileURLToPath(import.meta.url), "../");
// 判断是否GithubAction
const isGitHubActions = process.env.GITHUB_ACTIONS === "true";
// 获取版本
const pkgVersion = pkgJson.version;
// 获取版本优先使用环境变量CI 场景的 git tag否则使用 package.json
const appVersion = process.env.APP_VERSION?.replace(/^v/, "") || pkgJson.version;
console.log(`📌 Version source: ${process.env.APP_VERSION ? "APP_VERSION env" : "package.json"}`);
console.log(`📌 App version: ${appVersion}`);
// 解析命令行参数
const args = process.argv.slice(2);
@@ -30,7 +32,7 @@ const platform = process.platform;
console.log(`🖥️ Build platform: ${platform}`);
// 构建 Release 字符串
const release = `TeyvatGuide@${pkgVersion}`;
const release = `TeyvatGuide@${appVersion}`;
console.log(`🍄 gen sentry release ${release} env`);
// 修改 .env.production