Skip to content

Commit 5fb0f1f

Browse files
committed
fix(packaging): add CPU and GPU installer variants
- Matrix build in packaging.yml for CPU (gui only) and GPU (gpu,gui) extras - PyInstaller hook conditionally collects CUDA packages only if installed - Export CUDA_PACKAGES constant from utils/gpu.py for hook reuse - Installer filename now includes variant suffix (-CPU/-GPU) - Update READMEs to document both download options
1 parent ccf434e commit 5fb0f1f

6 files changed

Lines changed: 32 additions & 12 deletions

File tree

.github/workflows/packaging.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ jobs:
1212
build:
1313
runs-on: windows-latest
1414

15+
strategy:
16+
matrix:
17+
include:
18+
- variant: CPU
19+
extras: "gui"
20+
- variant: GPU
21+
extras: "gpu,gui"
22+
1523
defaults:
1624
run:
1725
shell: bash
@@ -29,7 +37,8 @@ jobs:
2937
run: |
3038
VERSION="${GITHUB_REF#refs/tags/v}"
3139
echo "VERSION=$VERSION" >> "$GITHUB_ENV"
32-
echo "Detected version: $VERSION"
40+
echo "VARIANT=${{ matrix.variant }}" >> "$GITHUB_ENV"
41+
echo "Detected version: $VERSION, variant: ${{ matrix.variant }}"
3342
3443
- name: Set up Python
3544
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
@@ -41,7 +50,7 @@ jobs:
4150
- name: Install dependencies
4251
run: |
4352
python -m pip install --upgrade pip
44-
pip install -e ".[gpu,gui]"
53+
pip install -e ".[${{ matrix.extras }}]"
4554
pip install pyinstaller
4655
4756
- name: Build executable with PyInstaller
@@ -69,13 +78,13 @@ jobs:
6978

7079
- name: Generate SHA256 checksum
7180
run: |
72-
INSTALLER="dist/Expressive-GUI-$VERSION-Windows-x64.exe"
81+
INSTALLER="dist/Expressive-GUI-$VERSION-Windows-x64-${{ matrix.variant }}.exe"
7382
sha256sum "$INSTALLER" > "$INSTALLER.sha256"
7483
cat "$INSTALLER.sha256"
7584
7685
- name: Upload to GitHub Release
7786
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2
7887
with:
7988
files: |
80-
dist/Expressive-GUI-${{ env.VERSION }}-Windows-x64.exe
81-
dist/Expressive-GUI-${{ env.VERSION }}-Windows-x64.exe.sha256
89+
dist/Expressive-GUI-${{ env.VERSION }}-Windows-x64-${{ matrix.variant }}.exe
90+
dist/Expressive-GUI-${{ env.VERSION }}-Windows-x64-${{ matrix.variant }}.exe.sha256

README.en.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ If your system has an NVIDIA GPU driver that supports [CUDA 11.x](https://docs.n
7373

7474
You can download pre-compiled executable files directly from the [Releases](https://github.com/NewComer00/expressive/releases) page:
7575

76-
- `Expressive-GUI-<version>-Windows-x64.exe`: GUI installer for Windows x64 architecture (includes GPU acceleration support)
76+
- `Expressive-GUI-<version>-Windows-x64-CPU.exe`: GUI installer for Windows x64, CPU-only (no CUDA dependencies)
77+
- `Expressive-GUI-<version>-Windows-x64-GPU.exe`: GUI installer for Windows x64 with NVIDIA GPU acceleration (requires driver >= 450, CUDA 11.x)
7778

7879
## 👨‍💻 Install from Source
7980

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@
7474

7575
您可以直接在 [Releases](https://github.com/NewComer00/expressive/releases) 页面下载预编译的可执行文件:
7676

77-
- `Expressive-GUI-<version>-Windows-x64.exe`: 适用于 x64 架构 Windows 的图形用户界面版本的安装包(包含GPU加速支持)
77+
- `Expressive-GUI-<version>-Windows-x64-CPU.exe`: 适用于 x64 架构 Windows 的图形用户界面安装包(仅 CPU,无 CUDA 依赖)
78+
- `Expressive-GUI-<version>-Windows-x64-GPU.exe`: 适用于 x64 架构 Windows 的图形用户界面安装包(含 NVIDIA GPU 加速,需驱动版本 >= 450,支持 CUDA 11.x)
7879

7980
## 👨‍💻 源码安装
8081

build/hooks/hook-utils.gpu.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import importlib.util
2+
3+
from utils.gpu import CUDA_PACKAGES
4+
5+
hiddenimports = [pkg for pkg in CUDA_PACKAGES if importlib.util.find_spec(pkg) is not None]

build/installer.iss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#define AppVersion GetEnv("VERSION")
2+
#define Variant GetEnv("VARIANT")
23

34
[Setup]
45
AppName=Expressive-GUI
@@ -8,7 +9,7 @@ ArchitecturesInstallIn64BitMode=x64compatible
89
DefaultDirName={autopf}\Expressive-GUI
910
DefaultGroupName=Expressive-GUI
1011
OutputDir=..\dist
11-
OutputBaseFilename=Expressive-GUI-{#AppVersion}-Windows-x64
12+
OutputBaseFilename=Expressive-GUI-{#AppVersion}-Windows-x64-{#Variant}
1213
Compression=lzma
1314
SolidCompression=yes
1415
LZMAUseSeparateProcess=yes

utils/gpu.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,15 @@
66
logger = logging.getLogger(__name__)
77

88

9+
CUDA_PACKAGES = [
10+
"nvidia.cuda_nvcc", "nvidia.cuda_runtime", "nvidia.cudnn", "nvidia.cublas",
11+
"nvidia.cusolver", "nvidia.cusparse", "nvidia.cufft", "nvidia.curand",
12+
]
13+
14+
915
def add_cuda_to_path(skip_missing: bool = False):
1016
"""Add CUDA to library searching path."""
11-
packages = [
12-
"nvidia.cuda_nvcc", "nvidia.cuda_runtime", "nvidia.cudnn", "nvidia.cublas",
13-
"nvidia.cusolver", "nvidia.cusparse", "nvidia.cufft", "nvidia.curand",
14-
]
17+
packages = CUDA_PACKAGES
1518

1619
missing = []
1720
for package_name in packages:

0 commit comments

Comments
 (0)