Skip to content

Commit

Permalink
remove UPX action, let's do it manually so bundlers get it
Browse files Browse the repository at this point in the history
  • Loading branch information
AmyrAhmady committed Jan 28, 2024
1 parent 85e26c1 commit db3bd1a
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 10 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,6 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run UPX against portable version
uses: crazy-max/ghaction-upx@v3
with:
version: latest
files: |
./src-tauri/target/release/omp-launcher.exe
args: -9 -fq

- name: Generate artifact name
id: vars
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@
"typescript": "^5.3.3",
"vite": "^5.0.12"
}
}
}
1 change: 1 addition & 0 deletions src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"build": {
"beforeDevCommand": "yarn dev",
"beforeBuildCommand": "yarn build",
"beforeBundleCommand": "node src-tauri/upx/upx.js",
"devPath": "http://localhost:1420",
"distDir": "../dist",
"withGlobalTauri": false
Expand Down
Binary file added src-tauri/upx/linux
Binary file not shown.
18 changes: 18 additions & 0 deletions src-tauri/upx/upx.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { exec } from "child_process";

let cmd = "--best --brute ./src-tauri/target/release/omp-launcher";
if (process.platform === "win32") {
cmd += ".exe";
cmd = "\"./src-tauri/upx/win.exe\" " + cmd;
} else {
cmd = "src-tauri/upx/linux " + cmd;
}

exec(cmd, (err, stdout, stderr) => {
if (err) {
console.error(err);
return;
}
console.log(`stdout: ${stdout}`);
console.error(`stderr: ${stderr}`);
});
Binary file added src-tauri/upx/win.exe
Binary file not shown.
1 change: 0 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4287,7 +4287,6 @@ supports-preserve-symlinks-flag@^1.0.0:

"tauri-plugin-upload-api@https://github.com/tauri-apps/tauri-plugin-upload#v1":
version "0.0.0"
uid "8e8f120ea7c90a51fb5498f24d42f1884a49ec4d"
resolved "https://github.com/tauri-apps/tauri-plugin-upload#8e8f120ea7c90a51fb5498f24d42f1884a49ec4d"
dependencies:
"@tauri-apps/api" "1.5.3"
Expand Down

0 comments on commit db3bd1a

Please sign in to comment.