mirror of
https://github.com/patarapolw/cjdic2.git
synced 2026-11-09 17:39:35 +00:00
release.js script
This commit is contained in:
1 parent
8242ace3fe
commit
8e47278d2a
3 files changed
+33
No files matched your search
+30
@@ -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`),
|
||||
);
|
||||
Reference in new issue
Block a user