132 lines
4.4 KiB
YAML
132 lines
4.4 KiB
YAML
name: Build Windows EXE
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- 'main'
|
|
- 'feature/client-tweaks'
|
|
- 'test/discord-presence'
|
|
- 'test/ui-scaling'
|
|
tags:
|
|
- 'v*'
|
|
pull_request:
|
|
branches:
|
|
- 'main'
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
concurrency:
|
|
group: modernization-${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: windows-2025
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.11.9'
|
|
|
|
- name: Install pinned build toolchain
|
|
run: python -m pip install --disable-pip-version-check -r requirements-build.txt
|
|
|
|
- name: Verify build toolchain
|
|
run: |
|
|
python --version
|
|
pyinstaller --version
|
|
python -m pip show pyinstaller pyinstaller-hooks-contrib
|
|
|
|
- name: Configure x86 MSVC
|
|
uses: ilammy/msvc-dev-cmd@v1
|
|
with:
|
|
arch: x86
|
|
|
|
- name: Prepare bundled remote fallbacks
|
|
run: python scripts/prepare_remote_fallbacks.py
|
|
|
|
- name: Syntax check
|
|
run: python -m py_compile setup_tool.py setup_tool_dynamic.py remote_packages.py tests/test_safety.py scripts/prepare_remote_fallbacks.py ui_scaling_test.py
|
|
|
|
- name: Unit safety tests
|
|
run: python -m unittest discover -s tests -v
|
|
|
|
- name: Build EXE
|
|
run: >
|
|
pyinstaller
|
|
--noconsole
|
|
--onefile
|
|
--icon=PurpleWowLogo.ico
|
|
--add-data "PurpleWowLogo.ico;."
|
|
--add-data "Payload;Payload"
|
|
--add-data "vanilla-tweaks.exe;."
|
|
--name "WoW_Modernization_Tool"
|
|
ui_scaling_test.py
|
|
|
|
- name: Verify EXE exists
|
|
shell: pwsh
|
|
run: |
|
|
if (-not (Test-Path "dist/WoW_Modernization_Tool.exe")) { throw "Build output missing" }
|
|
Get-Item "dist/WoW_Modernization_Tool.exe" | Format-List Name,Length,LastWriteTime
|
|
|
|
- name: Create ZIP package
|
|
shell: pwsh
|
|
run: |
|
|
$zip = "dist/WoW_Modernization_Tool.zip"
|
|
if (Test-Path $zip) { Remove-Item $zip -Force }
|
|
Compress-Archive -Path "dist/WoW_Modernization_Tool.exe" -DestinationPath $zip -CompressionLevel Optimal
|
|
if (-not (Test-Path $zip)) { throw "ZIP package missing" }
|
|
Get-Item $zip | Format-List Name,Length,LastWriteTime
|
|
|
|
- name: Upload test artifact
|
|
if: ${{ !startsWith(github.ref, 'refs/tags/') && !(github.ref == 'refs/heads/main' && github.event.head_commit.message == 'release v2.3') }}
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: WoW_Modernization_Tool-ui-scaling-test
|
|
path: |
|
|
dist/WoW_Modernization_Tool.exe
|
|
dist/WoW_Modernization_Tool.zip
|
|
if-no-files-found: error
|
|
|
|
# One-time production promotion for v2.3. The exact commit message keeps
|
|
# normal main pushes from publishing or modifying the v2.3 release.
|
|
# Keep the Git tag aligned with the exact commit used to build the assets.
|
|
- name: Synchronize Git tag v2.3
|
|
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && github.event.head_commit.message == 'release v2.3' }}
|
|
shell: pwsh
|
|
run: |
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
git tag -f v2.3 "${{ github.sha }}"
|
|
git push origin refs/tags/v2.3 --force
|
|
|
|
- name: Create GitHub Release v2.3
|
|
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && github.event.head_commit.message == 'release v2.3' }}
|
|
uses: softprops/action-gh-release@v3
|
|
with:
|
|
tag_name: v2.3
|
|
target_commitish: ${{ github.sha }}
|
|
files: |
|
|
dist/WoW_Modernization_Tool.exe
|
|
dist/WoW_Modernization_Tool.zip
|
|
fail_on_unmatched_files: true
|
|
overwrite_files: true
|
|
name: "WoW Modernization Tool v2.3"
|
|
body_path: RELEASE_NOTES.md
|
|
generate_release_notes: false
|
|
make_latest: true
|
|
|
|
- name: Create GitHub Release
|
|
if: ${{ startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/tags/v2.3' }}
|
|
uses: softprops/action-gh-release@v3
|
|
with:
|
|
files: |
|
|
dist/WoW_Modernization_Tool.exe
|
|
dist/WoW_Modernization_Tool.zip
|