88 lines
2.6 KiB
YAML
88 lines
2.6 KiB
YAML
name: Windows Package CI
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- "bin/**"
|
|
- "douyin/**"
|
|
- "gui/**"
|
|
- "operations/**"
|
|
- "packaging/**"
|
|
- "tools/**"
|
|
- "tests/**"
|
|
- "webui/**"
|
|
- "pyproject.toml"
|
|
- "requirements.txt"
|
|
- ".github/workflows/windows-package-ci.yml"
|
|
|
|
jobs:
|
|
package-fresh-install:
|
|
runs-on: windows-latest
|
|
timeout-minutes: 90
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.12"
|
|
cache: "pip"
|
|
|
|
- name: Install Inno Setup
|
|
shell: powershell
|
|
run: choco install innosetup --yes --no-progress
|
|
|
|
- name: Install Python dependencies
|
|
shell: powershell
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
python -m pip install -r requirements.txt
|
|
python -m pip install pyinstaller cython setuptools wheel
|
|
|
|
- name: Run fast regression tests
|
|
shell: powershell
|
|
run: >
|
|
python -m pytest
|
|
tests/test_web_gui_routes_logic.py
|
|
tests/test_startup_update_bootstrap.py
|
|
tests/test_distribution_manifest.py
|
|
tests/test_exe_packing.py
|
|
tests/test_auto_update.py
|
|
tests/test_version_consistency.py
|
|
tests/test_tools_dev.py
|
|
tests/test_ci_fresh_install.py
|
|
|
|
- name: Build portable package
|
|
shell: powershell
|
|
run: powershell -NoProfile -ExecutionPolicy Bypass -File packaging\pyinstaller\build_windows.ps1 -SkipInstall -ReuseCache
|
|
|
|
- name: Build installer
|
|
shell: powershell
|
|
run: |
|
|
$version = python -c "from douyin.core.version import APP_VERSION; print(str(APP_VERSION).lstrip('Vv'))"
|
|
$iscc = @(
|
|
"${env:ProgramFiles(x86)}\Inno Setup 6\ISCC.exe",
|
|
"${env:ProgramFiles}\Inno Setup 6\ISCC.exe",
|
|
"${env:LOCALAPPDATA}\Programs\Inno Setup 6\ISCC.exe"
|
|
) | Where-Object { Test-Path $_ } | Select-Object -First 1
|
|
if (-not $iscc) { throw "ISCC.exe not found" }
|
|
& $iscc packaging\inno\douyin_guaji.iss /DMyAppVersion=$version
|
|
|
|
- name: Fresh install smoke test
|
|
shell: powershell
|
|
run: powershell -NoProfile -ExecutionPolicy Bypass -File tools\ci\fresh_install_smoke.ps1
|
|
|
|
- name: Upload package and smoke report
|
|
uses: actions/upload-artifact@v4
|
|
if: always()
|
|
with:
|
|
name: douyin-guaji-windows-package
|
|
path: |
|
|
dist/installer/*.exe
|
|
artifacts/fresh_install_ci/**
|
|
if-no-files-found: ignore
|