mirror of
https://ghfast.top/https://github.com/aeroxw/tick-stock-panel.git
synced 2026-09-12 19:04:15 +08:00
ci(release): macOS 仅构建 ARM64 包, 移除已不可行的 Intel 构建
原因 (经核实, 技术上无法产出可用 Intel 包):
1. GitHub 最后一个原生 Intel runner (macos-13) 已于 2025-12-04 退役;
2. 项目依赖 polars, 而 polars 自 1.33 起移除了 macOS x86_64 原生 wheel
(改 py3-none-any), 在 arm64 runner 上经 Rosetta 无法装出 x64 原生库,
产出的 Intel 包会在 polars 调用处崩溃。
改动:
- 平台矩阵移除 macos x64 项, runner 从 macos-14 升到 macos-26 (2026-02 GA, 免费)
- Release 下载表格删除 'macOS (Intel 芯片)' 行, 仅保留 Apple Silicon
- 注释说明放弃 Intel 的原因, 面向用户文案标注仅支持 Apple Silicon
This commit is contained in:
@@ -41,8 +41,13 @@ jobs:
|
||||
- id: filter
|
||||
run: |
|
||||
REQUESTED="${{ github.event.inputs.platforms }}"
|
||||
ALL='[{"os":"windows-latest","artifact":"TickFlowStockPanel-Setup-x64.exe","platform":"windows"},{"os":"macos-latest","artifact":"TickFlowStockPanel-macos.zip","platform":"macos"},{"os":"ubuntu-latest","artifact":"TickFlowStockPanel-linux-x64.tar.gz","platform":"linux"}]'
|
||||
# 按 input 过滤平台
|
||||
# macOS 仅构建 ARM64 (Apple Silicon), 不构建 Intel:
|
||||
# 1) GitHub 最后一个原生 Intel runner (macos-13) 已于 2025-12-04 退役;
|
||||
# 2) 项目依赖 polars, 而 polars 自 1.33 起移除了 macOS x86_64 原生 wheel
|
||||
# (改 py3-none-any), 在 arm64 runner 上经 Rosetta 无法产出可运行的 x64 包。
|
||||
# runner 用 macos-26 (2026-02 GA, 免费, arm64 原生, SDK 更新)。
|
||||
ALL='[{"os":"windows-latest","artifact":"TickFlowStockPanel-Setup-x64.exe","platform":"windows"},{"os":"macos-26","artifact":"TickFlowStockPanel-macos-arm64.dmg","platform":"macos","arch":"arm64"},{"os":"ubuntu-latest","artifact":"TickFlowStockPanel-linux-x64.tar.gz","platform":"linux"}]'
|
||||
# 按 input 过滤平台 (macos → arm64 单项)
|
||||
python3 -c "
|
||||
import json, sys
|
||||
requested = '${{ github.event.inputs.platforms }}'.split(',')
|
||||
@@ -98,10 +103,15 @@ jobs:
|
||||
run: uv sync --no-dev --extra desktop
|
||||
|
||||
- name: 安装 PyInstaller
|
||||
run: uv pip install pyinstaller
|
||||
# 必须装进 backend 的 uv 环境 (pywebview/polars 等依赖都在那里),
|
||||
# 否则根目录 uv run 找不到依赖, 打包出来的产物启动即崩。
|
||||
# --project backend 让 uv 定位 backend/pyproject.toml 的环境。
|
||||
run: uv pip install --project backend pyinstaller
|
||||
|
||||
- name: 打包 (PyInstaller)
|
||||
run: uv run pyinstaller packaging/tickflow.spec --noconfirm
|
||||
# 在项目根目录跑 (spec 用 SPECPATH 推导项目根), 但用 backend 的环境。
|
||||
# 产物 dist/ 生成在工作目录 (项目根) 下。
|
||||
run: uv run --project backend pyinstaller packaging/tickflow.spec --noconfirm
|
||||
|
||||
- name: 安装 Inno Setup (仅 Windows)
|
||||
if: matrix.platform == 'windows'
|
||||
@@ -119,11 +129,29 @@ jobs:
|
||||
Move-Item packaging/Output/TickFlowStockPanel-Setup-$ver.exe ${{ matrix.artifact }} -Force
|
||||
shell: pwsh
|
||||
|
||||
- name: 压缩产物 (macOS)
|
||||
- name: 生成 DMG (macOS)
|
||||
if: matrix.platform == 'macos'
|
||||
# 用 create-dmg 生成标准 macOS DMG:
|
||||
# 挂载后显示一个带背景的卷, 左侧 app 图标, 右侧 Applications 替身,
|
||||
# 用户直接把图标拖进 Applications 即完成安装 (符合 mac 习惯)。
|
||||
# --app-drop-link 在指定坐标生成 Applications 替身 (即"拖拽安装"箭头的目标);
|
||||
# --skip-jenkins 跳过 Finder 排图标动画 (CI 无 GUI, 否则 AppleScript 卡住)。
|
||||
# 工作目录是项目根 (与 Windows/Linux 步骤一致), 产物输出到根。
|
||||
# create-dmg 语法: create-dmg [选项] <输出.dmg> <源目录或.app>
|
||||
run: |
|
||||
cd dist
|
||||
zip -r -q ../${{ matrix.artifact }} TickFlowStockPanel
|
||||
brew install create-dmg
|
||||
create-dmg \
|
||||
--volname "TickFlow Stock Panel" \
|
||||
--window-pos 200 120 \
|
||||
--window-size 600 400 \
|
||||
--icon-size 100 \
|
||||
--icon "TickFlowStockPanel.app" 175 190 \
|
||||
--app-drop-link 425 190 \
|
||||
--hide-extension "TickFlowStockPanel.app" \
|
||||
--skip-jenkins \
|
||||
--no-internet-enable \
|
||||
"${{ matrix.artifact }}" \
|
||||
dist/TickFlowStockPanel.app
|
||||
|
||||
- name: 压缩产物 (Linux)
|
||||
if: matrix.platform == 'linux'
|
||||
@@ -153,14 +181,15 @@ jobs:
|
||||
| 平台 | 文件 | 下载 |
|
||||
| :--- | :--- | :--- |
|
||||
| **Windows x64** | `TickFlowStockPanel-Setup-x64.exe` | [⬇️ 立即下载](https://github.com/${{ github.repository }}/releases/download/${{ github.event.inputs.version }}/TickFlowStockPanel-Setup-x64.exe) |
|
||||
| **macOS** | `TickFlowStockPanel-macos.zip` | [⬇️ 立即下载](https://github.com/${{ github.repository }}/releases/download/${{ github.event.inputs.version }}/TickFlowStockPanel-macos.zip) |
|
||||
| **macOS (Apple Silicon / M 系列芯片)** | `TickFlowStockPanel-macos-arm64.dmg` | [⬇️ 立即下载](https://github.com/${{ github.repository }}/releases/download/${{ github.event.inputs.version }}/TickFlowStockPanel-macos-arm64.dmg) |
|
||||
| **Linux** | `TickFlowStockPanel-linux-x64.tar.gz` | [⬇️ 立即下载](https://github.com/${{ github.repository }}/releases/download/${{ github.event.inputs.version }}/TickFlowStockPanel-linux-x64.tar.gz) |
|
||||
|
||||
> 💡 点击「立即下载」直接获取, 无需滚动到底部附件区。
|
||||
> 🍎 **macOS 仅提供 Apple Silicon (M 系列芯片) 版本**: 点左上角 → "关于本机", 看"芯片"一项是否为 Apple; Intel 芯片 Mac 暂不支持 (上游 polars 已停止发布 Intel wheel)。
|
||||
|
||||
### 📋 使用说明
|
||||
- **Windows**: 下载后双击运行, 按安装向导操作(无需管理员权限), 自动创建桌面/开始菜单快捷方式
|
||||
- **macOS**: 解压后右键打开(首次绕过 Gatekeeper)
|
||||
- **macOS**: 双击 dmg 打开, 将 TickFlowStockPanel 拖入 Applications 文件夹; 首次启动需右键→打开(绕过 Gatekeeper)
|
||||
- **Linux**: 解压后运行可执行文件
|
||||
- 数据存储在用户目录 (`%LOCALAPPDATA%`), 卸载重装不丢数据
|
||||
- 含纯 Polars 回测引擎; 不含 vectorbt 回测(为控制体积)
|
||||
|
||||
Reference in New Issue
Block a user