-
Notifications
You must be signed in to change notification settings - Fork 0
120 lines (103 loc) · 4.34 KB
/
Copy pathwindows.yml
File metadata and controls
120 lines (103 loc) · 4.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: Windows Build (MSI)
on:
push:
branches: [main]
tags: ['*']
pull_request:
branches: [main]
concurrency:
group: '${{ github.workflow }}-${{ github.head_ref || github.ref_name }}'
cancel-in-progress: true
env:
BUILD_TYPE: Release
QT_VERSION: '6.7.3'
jobs:
build-windows:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Initialize submodules
# wows-model-exporter/deps/wows-depack is intentionally skipped: commit
# 8c24c7b contains fuzzing corpus files with colons in their names, which
# are illegal on Windows. The top-level wows-depack submodule is used for
# the build instead.
run: |
git submodule update --init deps/wows-depack deps/vcpkg deps/wows-model-exporter
git -C deps/wows-model-exporter submodule update --init deps/stb
shell: pwsh
# ── vcpkg binary cache (keyed on submodule HEAD + manifest) ─────
- name: Create vcpkg cache dir
run: mkdir -Force cache
shell: pwsh
- name: Cache vcpkg packages
uses: actions/cache@v4
with:
path: cache
key: ${{ github.workflow }}-vcpkg-${{ hashFiles('.git/modules/*/HEAD') }}-${{ hashFiles('vcpkg.json') }}
- name: Set VCPKG_DEFAULT_BINARY_CACHE
run: echo "VCPKG_DEFAULT_BINARY_CACHE=${{ github.workspace }}\cache" >> $env:GITHUB_ENV
shell: pwsh
# ── Qt (not in vcpkg — installed separately) ─────────────────
- name: Install Qt ${{ env.QT_VERSION }}
uses: jurplel/install-qt-action@v4
with:
version: ${{ env.QT_VERSION }}
host: windows
target: desktop
arch: win64_msvc2019_64
modules: qtquick3d qtshadertools qtquicktimeline
cache: true
# ── Python (needed for embedding in the app) ─────────────────
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
# ── Configure and build (mirrors: .\windows\scripts\build-windows.ps1) ──
- name: Configure and build
run: .\windows\scripts\build-windows.ps1
shell: pwsh
# ── Determine version ─────────────────────────────────────────
- name: Determine version
id: version
run: |
if ("${{ github.ref }}" -match '^refs/tags/(.+)$') { $v = $Matches[1] } else { $v = "latest" }
echo "version=$v" >> $env:GITHUB_OUTPUT
shell: pwsh
# ── Install, bundle Qt/Python, create MSI (mirrors: .\windows\scripts\create-msi.ps1) ──
- name: Create MSI
run: .\windows\scripts\create-msi.ps1 -Version '${{ steps.version.outputs.version }}'
shell: pwsh
- name: Upload MSI artifact
uses: actions/upload-artifact@v4
with:
name: wows-extractor-gui-${{ steps.version.outputs.version }}-win64
path: "${{ github.workspace }}\\*.msi"
if-no-files-found: error
- name: Attach MSI to GitHub Release
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
$msi = Get-Item "${{ github.workspace }}\*.msi" | Select-Object -First 1
gh release view "${{ github.ref_name }}" 2>&1 | Out-Null
if ($LASTEXITCODE -ne 0) {
gh release create "${{ github.ref_name }}" --title "${{ github.ref_name }}" --generate-notes
}
gh release upload "${{ github.ref_name }}" $msi.FullName --clobber
shell: pwsh
- name: Publish to unstable pre-release (main branch)
if: github.ref == 'refs/heads/main'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
$msi = Get-Item "${{ github.workspace }}\*.msi" | Select-Object -First 1
gh release view unstable 2>&1 | Out-Null
if ($LASTEXITCODE -ne 0) {
gh release create unstable `
--title "Unstable (latest main)" `
--notes "Automated build from the main branch. Not recommended for production use." `
--prerelease
}
gh release upload unstable $msi.FullName --clobber
shell: pwsh