Skip to content

Commit 7f91eec

Browse files
authored
Merge pull request #80 from fosslife/master
2 parents e2af17d + 6da182f commit 7f91eec

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

.github/workflows/release.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,15 @@ jobs:
3535
# webkitgtk 4.0 is for Tauri v1 - webkitgtk 4.1 is for Tauri v2.
3636
# You can remove the one that doesn't apply to your app to speed up the workflow a bit.
3737

38+
- name: Install package manager (from package.json)
39+
run: |
40+
corepack enable
41+
corepack install
42+
3843
- name: setup node
3944
uses: actions/setup-node@v4
4045
with:
46+
node-version-file: package.json
4147
node-version: lts/*
4248
cache: "yarn" # Set this to npm, yarn or pnpm.
4349

@@ -57,9 +63,9 @@ jobs:
5763

5864
- name: Install UPX
5965
if: matrix.settings.platform != 'macos-latest'
60-
uses: crazy-max/ghaction-upx@v2
66+
uses: crazy-max/ghaction-upx@v3
6167
with:
62-
version: latest
68+
install-only: true
6369

6470
- uses: tauri-apps/tauri-action@v0
6571
env:

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,5 +113,6 @@
113113
"rollup-plugin-visualizer": "^5.12.0",
114114
"typescript": "^5.4.3",
115115
"vite": "^5.2.7"
116-
}
117-
}
116+
},
117+
"packageManager": "yarn@1.22.22"
118+
}

scripts/compress.mjs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function findBinary(dir) {
1212
const stat = fs.statSync(filePath);
1313
if (stat.isDirectory()) {
1414
// ignore
15-
} else if (file === "dev-tool" || file.includes("dev-tools.exe")) {
15+
} else if (file === "dev-tools" || file === "dev-tools.exe") {
1616
return filePath;
1717
}
1818
}
@@ -23,6 +23,13 @@ const targetDir = path.join(".", "src-tauri", "target", "release");
2323
const binaryPath = findBinary(targetDir);
2424

2525
if (binaryPath) {
26+
// check if current OS is darwin
27+
28+
let osname = process.platform;
29+
if (osname === "darwin") {
30+
console.log("OS is darwin, skipping UPX compression");
31+
process.exit(0);
32+
}
2633
console.log(`Found binary: ${binaryPath}`);
2734
try {
2835
execSync(`upx --best --lzma "${binaryPath}"`);
@@ -33,5 +40,5 @@ if (binaryPath) {
3340
}
3441
} else {
3542
console.error("Binary not found");
36-
process.exit(1);
43+
process.exit(0);
3744
}

0 commit comments

Comments
 (0)