workflow: remove 32-bit platform (#2855)

* chore: build portable by self

* chore: remove 32bit platform

* Update CONTRIBUTING.md

* update alpha version
This commit is contained in:
Christine.
2025-03-03 01:16:33 +08:00
committed by GitHub
parent 97d683541d
commit 9bb2160abe
7 changed files with 35 additions and 72 deletions

View File

@@ -26,29 +26,41 @@ async function getLatestCommitHash() {
/**
* @param string 传入格式化后的hash
* 将新的版本号写入文件 package.json
* 将新的版本号写入文件 package.json / tauri.conf.json
*/
async function updatePackageVersion(newVersion) {
// 获取内容根目录
const _dirname = process.cwd();
const packageJsonPath = path.join(_dirname, "package.json");
const tauriDir = path.join(_dirname, "src-tauri");
const internalfile = path.join(tauriDir, "tauri.conf.json");
try {
const data = await fs.readFile(packageJsonPath, "utf8");
const tauriData = await fs.readFile(internalfile, "utf8");
const packageJson = JSON.parse(data);
const initversion = packageJson.version;
// 将匹配到的第一个 "alpha" => 具体的hash
const fixversion = initversion.replace("alpha", newVersion);
packageJson.version = fixversion;
const tauriJson = JSON.parse(tauriData);
let result = packageJson.version.replace("alpha", newVersion);
console.log("[INFO]: Current version is: ", result);
packageJson.version = result;
tauriJson.version = result;
// 写入版本号
await fs.writeFile(
packageJsonPath,
JSON.stringify(packageJson, null, 2),
"utf8",
);
console.log(`Alpha version update to: ${fixversion}`);
await fs.writeFile(
internalfile,
JSON.stringify(tauriJson, null, 2),
"utf8",
);
console.log(`[INFO]: Alpha version update to: ${newVersion}`);
} catch (error) {
console.error("pnpm run fix-alpha-version ERROR", error);
}
}
const newVersion = await getLatestCommitHash();
updatePackageVersion(newVersion);
updatePackageVersion(newVersion).catch(console.error);