mirror of
https://github.com/hyb-oyqq/FRAISEMOE-Addons-Installer-NEXT.git
synced 2026-01-06 17:10:14 +00:00
在 PyInstaller 构建命令中添加了新的数据目录 (bin, ui) 和多个隐藏导入模块, 包括 workers、core、handlers、utils 和 ui 等子模块。同时使用 --collect-submodules 选项确保所有相关子模块被正确收集,以解决打包后可能缺失依赖的问题。
80 lines
2.6 KiB
YAML
80 lines
2.6 KiB
YAML
name: Build and Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*' # 当推送 v 开头的 tag 时触发,如 v1.0.0
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.11'
|
|
cache: 'pip'
|
|
cache-dependency-path: 'source/requirements.txt'
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -r source/requirements.txt
|
|
|
|
- name: Get version from tag
|
|
id: get_version
|
|
run: |
|
|
$version = "${{ github.ref_name }}"
|
|
echo "VERSION=$version" >> $env:GITHUB_OUTPUT
|
|
|
|
- name: Build with PyInstaller
|
|
run: |
|
|
cd source
|
|
pyinstaller --noconfirm --onefile --windowed --name "FRAISEMOE_Addons_Installer_NEXT" `
|
|
--icon "assets/images/ICO/icon.ico" `
|
|
--add-data "assets;assets" `
|
|
--add-data "data;data" `
|
|
--add-data "config;config" `
|
|
--add-data "bin;bin" `
|
|
--add-data "ui;ui" `
|
|
--hidden-import "workers" `
|
|
--hidden-import "workers.extraction_thread" `
|
|
--hidden-import "workers.config_fetch_thread" `
|
|
--hidden-import "workers.download" `
|
|
--hidden-import "workers.hash_thread" `
|
|
--hidden-import "workers.ip_optimizer" `
|
|
--hidden-import "core" `
|
|
--hidden-import "core.managers" `
|
|
--hidden-import "core.handlers" `
|
|
--hidden-import "handlers" `
|
|
--hidden-import "utils" `
|
|
--hidden-import "ui" `
|
|
--hidden-import "ui.components" `
|
|
--collect-submodules "workers" `
|
|
--collect-submodules "core" `
|
|
--collect-submodules "ui" `
|
|
--collect-submodules "utils" `
|
|
--collect-submodules "handlers" `
|
|
Main.py
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: release-${{ steps.get_version.outputs.VERSION }}
|
|
path: source/dist/FRAISEMOE_Addons_Installer_NEXT.exe
|
|
|
|
- name: Create Release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
name: release-${{ steps.get_version.outputs.VERSION }}
|
|
files: source/dist/FRAISEMOE_Addons_Installer_NEXT.exe
|
|
draft: false
|
|
prerelease: false
|
|
generate_release_notes: true
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|