release.js script

This commit is contained in:
polv committed 2026-03-10 15:40:10 +07:00
1 parent 8242ace3fe
commit 8e47278d2a
3 files changed
+33

No files matched your search

+30
View File
@@ -0,0 +1,30 @@
import fs from "node:fs";
import path from "node:path";
import { spawnSync } from "node:child_process";
spawnSync("pnpm", ["run", "build:desktop"], {
stdio: "inherit",
shell: true,
});
spawnSync("pnpm", ["run", "build:android"], {
stdio: "inherit",
shell: true,
});
const file_stem = fs
.readdirSync("target/release/bundle/msi", { withFileTypes: true })
.sort((f) => {
return fs.statSync(path.join(f.parentPath, f.name)).mtime;
})
.pop()
.name.split("_x64")[0];
const apk_dir = "target/release/bundle/apk";
try {
fs.mkdirSync(apk_dir);
} catch (e) {}
fs.copyFileSync(
"src-tauri/gen/android/app/build/outputs/apk/universal/release/app-universal-release.apk",
path.join(apk_dir, `${file_stem}.apk`),
);