From 372bada160756249f055013161cea39fc073d453 Mon Sep 17 00:00:00 2001 From: This-is-XiaoDeng <1744793737@qq.com> Date: Thu, 13 Aug 2026 18:09:37 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E6=9E=84=E5=BB=BA=E5=89=8D=E5=AE=89?= =?UTF-8?q?=E8=A3=85=20zstandard=EF=BC=8C=E5=90=AF=E7=94=A8=20Nuitka=20one?= =?UTF-8?q?file=20payload=20=E5=8E=8B=E7=BC=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Linux 产物 250MB 而 Windows/macOS 仅 ~37MB 的原因:Nuitka onefile 默认 用 zstandard 压缩 payload,但 Ubuntu runner 上找不到带 zstandard 的 Python,构建日志警告 'Onefile mode cannot compress without zstandard package installed',payload 原样打包。 修复:每个构建 job 在编译前 poetry run pip install zstandard (Nuitka 会扫描当前 Python),Linux 产物预计压缩到 ~40MB 级别。 --- .github/workflows/build-release.yml | 15 +++++++++++++++ .github/workflows/ci.yml | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index d2b7664..9852abc 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -69,6 +69,11 @@ jobs: run: | poetry install --all-groups + - name: "Install zstandard (Nuitka onefile compression)" + shell: bash + run: | + poetry run pip install zstandard + - name: "Build with Nuitka" shell: bash run: | @@ -192,6 +197,11 @@ jobs: run: | poetry install --all-groups + - name: "Install zstandard (Nuitka onefile compression)" + shell: bash + run: | + poetry run pip install zstandard + - name: "Build with Nuitka" run: | poetry run python -m nuitka \ @@ -305,6 +315,11 @@ jobs: run: | poetry install --all-groups + - name: "Install zstandard (Nuitka onefile compression)" + shell: bash + run: | + poetry run pip install zstandard + - name: "Build with Nuitka" run: | poetry run python -m nuitka \ diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eac5657..929b9c6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,6 +75,11 @@ jobs: run: | poetry install --all-groups + - name: "Install zstandard (Nuitka onefile compression)" + shell: bash + run: | + poetry run pip install zstandard + - name: "Build with Nuitka" shell: bash run: | @@ -199,6 +204,11 @@ jobs: run: | poetry install --all-groups + - name: "Install zstandard (Nuitka onefile compression)" + shell: bash + run: | + poetry run pip install zstandard + - name: "Build with Nuitka" run: | poetry run python -m nuitka \ @@ -320,6 +330,11 @@ jobs: run: | poetry install --all-groups + - name: "Install zstandard (Nuitka onefile compression)" + shell: bash + run: | + poetry run pip install zstandard + - name: "Build with Nuitka" run: | poetry run python -m nuitka \