Skip to content

Commit

Permalink
Merge pull request #80 from fosslife/master
Browse files Browse the repository at this point in the history
  • Loading branch information
Sparkenstein authored Jul 12, 2024
2 parents e2af17d + 6da182f commit 7f91eec
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,15 @@ jobs:
# webkitgtk 4.0 is for Tauri v1 - webkitgtk 4.1 is for Tauri v2.
# You can remove the one that doesn't apply to your app to speed up the workflow a bit.

- name: Install package manager (from package.json)
run: |
corepack enable
corepack install
- name: setup node
uses: actions/setup-node@v4
with:
node-version-file: package.json
node-version: lts/*
cache: "yarn" # Set this to npm, yarn or pnpm.

Expand All @@ -57,9 +63,9 @@ jobs:

- name: Install UPX
if: matrix.settings.platform != 'macos-latest'
uses: crazy-max/ghaction-upx@v2
uses: crazy-max/ghaction-upx@v3
with:
version: latest
install-only: true

- uses: tauri-apps/tauri-action@v0
env:
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,6 @@
"rollup-plugin-visualizer": "^5.12.0",
"typescript": "^5.4.3",
"vite": "^5.2.7"
}
}
},
"packageManager": "yarn@1.22.22"
}
11 changes: 9 additions & 2 deletions scripts/compress.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function findBinary(dir) {
const stat = fs.statSync(filePath);
if (stat.isDirectory()) {
// ignore
} else if (file === "dev-tool" || file.includes("dev-tools.exe")) {
} else if (file === "dev-tools" || file === "dev-tools.exe") {
return filePath;
}
}
Expand All @@ -23,6 +23,13 @@ const targetDir = path.join(".", "src-tauri", "target", "release");
const binaryPath = findBinary(targetDir);

if (binaryPath) {
// check if current OS is darwin

let osname = process.platform;
if (osname === "darwin") {
console.log("OS is darwin, skipping UPX compression");
process.exit(0);
}
console.log(`Found binary: ${binaryPath}`);
try {
execSync(`upx --best --lzma "${binaryPath}"`);
Expand All @@ -33,5 +40,5 @@ if (binaryPath) {
}
} else {
console.error("Binary not found");
process.exit(1);
process.exit(0);
}

0 comments on commit 7f91eec

Please sign in to comment.