mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2026-05-03 23:45:49 +08:00
💚 尝试调整CI
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user