mirror of
https://github.com/open-goal/launcher.git
synced 2024-10-19 14:47:36 -04:00
actions: mock binaries for the build
This commit is contained in:
parent
00a3457bb7
commit
95926ad62c
1
.github/workflows/build.yaml
vendored
1
.github/workflows/build.yaml
vendored
|
@ -40,6 +40,7 @@ jobs:
|
|||
- name: install app dependencies and build it
|
||||
run: |
|
||||
npm ci
|
||||
npm run mock-bin
|
||||
npm run build
|
||||
|
||||
- uses: tauri-apps/tauri-action@v0
|
||||
|
|
|
@ -12,7 +12,8 @@
|
|||
"package": "node ./scripts/rename-binaries.js",
|
||||
"update-bin": "node ./scripts/update-binaries.js && npm run package",
|
||||
"lint": "npx prettier --check .",
|
||||
"format": "npx prettier --write ."
|
||||
"format": "npx prettier --write .",
|
||||
"mock-bin": "node ./scripts/dummy-binaries.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@sveltejs/vite-plugin-svelte": "^1.0.0-next.30",
|
||||
|
|
22
scripts/dummy-binaries.js
Normal file
22
scripts/dummy-binaries.js
Normal file
|
@ -0,0 +1,22 @@
|
|||
/**
|
||||
* Used for builds / CI to basically mock the install process
|
||||
*
|
||||
* If Tauri can't find the binaries, it will fail (maybe there is a better way to ignore this though)
|
||||
*/
|
||||
|
||||
import { existsSync, rmdirSync, mkdirSync, writeFileSync } from "fs";
|
||||
|
||||
// Clear our current binaries
|
||||
if (existsSync("./src-tauri/bin")) {
|
||||
rmdirSync("./src-tauri/bin", { recursive: true, force: true });
|
||||
}
|
||||
// Recreate the directory
|
||||
mkdirSync("./src-tauri/bin");
|
||||
// Create empty executables
|
||||
let extension = "";
|
||||
if (process.platform === "win32") {
|
||||
extension = ".exe";
|
||||
}
|
||||
writeFileSync(`./src-tauri/bin/extractor${extension}`, "dummy");
|
||||
writeFileSync(`./src-tauri/bin/gk${extension}`, "dummy");
|
||||
writeFileSync(`./src-tauri/bin/goalc${extension}`, "dummy");
|
Loading…
Reference in a new issue