name: Build Windows EXE on: push: branches: - 'main' - 'feature/client-tweaks' - 'test/discord-presence' 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: Syntax check run: python -m py_compile setup_tool.py setup_tool_dynamic.py remote_packages.py tests/test_safety.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" setup_tool_dynamic.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/') }} uses: actions/upload-artifact@v4 with: name: WoW_Modernization_Tool-test path: | dist/WoW_Modernization_Tool.exe dist/WoW_Modernization_Tool.zip if-no-files-found: error # One-time production promotion for v2.0. The exact commit message keeps # normal main pushes from publishing or modifying the v2.0 release. - name: Create GitHub Release v2.0 if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && github.event.head_commit.message == 'release v2.0' }} uses: softprops/action-gh-release@v3 with: tag_name: v2.0 target_commitish: ${{ github.sha }} files: | dist/WoW_Modernization_Tool.exe dist/WoW_Modernization_Tool.zip fail_on_unmatched_files: true name: "WoW Modernization Tool v2.0" body_path: RELEASE_NOTES.md generate_release_notes: true previous_tag: v1.1 make_latest: true - name: Create GitHub Release if: ${{ startsWith(github.ref, 'refs/tags/') }} uses: softprops/action-gh-release@v3 with: files: | dist/WoW_Modernization_Tool.exe dist/WoW_Modernization_Tool.zip fail_on_unmatched_files: true name: "WoW Modernization Tool ${{ github.ref_name }}" body_path: RELEASE_NOTES.md generate_release_notes: true make_latest: true