Skip to content

Commit 9df2aca

Browse files
committed
fix: handle UPX on macOS and Windows
1 parent 01197de commit 9df2aca

5 files changed

Lines changed: 24 additions & 5 deletions

File tree

.github/workflows/release.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ jobs:
6161
shell: pwsh
6262
run: |
6363
Invoke-WebRequest https://github.com/upx/upx/releases/download/v5.1.0/upx-5.1.0-win64.zip -OutFile upx.zip
64+
Remove-Item -Recurse -Force upx-5.1.0-win64 -ErrorAction SilentlyContinue
6465
Expand-Archive -Path upx.zip -DestinationPath .
6566
- name: Install UPX 5.1.0 (Linux)
6667
if: runner.os == 'Linux'
@@ -88,9 +89,15 @@ jobs:
8889
else
8990
upx="$UPX_BIN"
9091
fi
92+
upx_args=(--best --lzma)
93+
upx_test_args=()
94+
if [ "$RUNNER_OS" = macOS ]; then
95+
upx_args+=(--force-macos)
96+
upx_test_args+=(--force-macos)
97+
fi
9198
unpacked_bytes=$(wc -c < "$binary")
92-
"$upx" --best --lzma "$binary"
93-
"$upx" -t "$binary"
99+
"$upx" "${upx_args[@]}" "$binary"
100+
"$upx" -t "${upx_test_args[@]}" "$binary"
94101
packed_bytes=$(wc -c < "$binary")
95102
{
96103
echo "## CLI ${{ matrix.name }}"

CHANGELOG.en.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ All notable changes to `ii` are documented here. The default Chinese version is
3131

3232
- The release workflow continues to report UPX-compressed CLI sizes for all targets, without blocking publication on a size limit.
3333

34+
## 0.1.16 - 2026-07-30
35+
36+
### Fixed
37+
38+
- Fixed platform-specific UPX release handling: clear a stale Windows extraction directory, and pass `--force-macos` when compressing macOS Mach-O binaries.
39+
3440
## Unreleased
3541

3642
Nothing yet.

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@
3131

3232
- Release 流水线继续报告三端 CLI 的 UPX 压缩大小,但不再以大小限制阻断发布。
3333

34+
## 0.1.16 - 2026-07-30
35+
36+
### 修复
37+
38+
- 修正 Release 流水线的 UPX 平台处理:Windows 解压前清理残留目录,macOS 压缩 Mach-O 时传入 `--force-macos`
39+
3440
## Unreleased
3541

3642
暂无。

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ exclude = ["vendor/iroh", "vendor/suppaftp"]
44
resolver = "3"
55

66
[workspace.package]
7-
version = "0.1.15"
7+
version = "0.1.16"
88
edition = "2024"
99
rust-version = "1.91"
1010
license = "MIT"

0 commit comments

Comments
 (0)