Skip to content

Commit 1883f2c

Browse files
committed
[GITHUB] Update CI to match new presets
1 parent 1589c55 commit 1883f2c

File tree

2 files changed

+22
-88
lines changed

2 files changed

+22
-88
lines changed

.github/workflows/build-toolchain.yml

Lines changed: 18 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414
preset:
1515
required: true
1616
type: string
17-
description: "CMake preset"
17+
description: "CMake configure preset"
1818
tools:
1919
required: false
2020
default: true
@@ -36,7 +36,7 @@ jobs:
3636
uses: actions/checkout@v4
3737

3838
- name: Cache VC6 Installation
39-
if: startsWith(inputs.preset, 'vc6')
39+
if: endsWith(inputs.preset, 'vc6')
4040
id: cache-vc6
4141
uses: actions/cache@v4
4242
with:
@@ -51,7 +51,7 @@ jobs:
5151
key: cmake-deps-${{ inputs.preset }}-${{ hashFiles('CMakePresets.json','cmake/**/*.cmake','**/CMakeLists.txt') }}
5252

5353
- name: Download VC6 Portable from Cloudflare R2
54-
if: ${{ startsWith(inputs.preset, 'vc6') && steps.cache-vc6.outputs.cache-hit != 'true' }}
54+
if: ${{ endsWith(inputs.preset, 'vc6') && steps.cache-vc6.outputs.cache-hit != 'true' }}
5555
env:
5656
AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
5757
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
@@ -66,7 +66,7 @@ jobs:
6666
$fileHash = (Get-FileHash -Path VS6_VisualStudio6.7z -Algorithm SHA256).Hash
6767
Write-Host "Downloaded file SHA256: $fileHash"
6868
Write-Host "Expected file SHA256: $env:EXPECTED_HASH"
69-
if ($hash -ne $env:EXPECTED_HASH) {
69+
if ($fileHash -ne $env:EXPECTED_HASH) {
7070
Write-Error "Hash verification failed! File may be corrupted or tampered with."
7171
exit 1
7272
}
@@ -76,16 +76,13 @@ jobs:
7676
Remove-Item VS6_VisualStudio6.7z -Verbose
7777
7878
- name: Set Up VC6 Environment
79-
if: startsWith(inputs.preset, 'vc6')
79+
if: endsWith(inputs.preset, 'vc6')
8080
shell: pwsh
8181
run: |
82-
# Define the base directories as local variables first
8382
$VSCommonDir = "C:\VC6\VC6SP6\Common"
8483
$MSDevDir = "C:\VC6\VC6SP6\Common\msdev98"
8584
$MSVCDir = "C:\VC6\VC6SP6\VC98"
8685
$VcOsDir = "WINNT"
87-
88-
# Set the variables in GitHub environment
8986
"VSCommonDir=$VSCommonDir" >> $env:GITHUB_ENV
9087
"MSDevDir=$MSDevDir" >> $env:GITHUB_ENV
9188
"MSVCDir=$MSVCDir" >> $env:GITHUB_ENV
@@ -95,56 +92,37 @@ jobs:
9592
"LIB=$MSVCDir\LIB;$MSVCDir\MFC\LIB;$env:LIB" >> $env:GITHUB_ENV
9693
9794
- name: Set Up VC2022 Environment
98-
if: startsWith(inputs.preset, 'win32')
95+
if: ${{ !endsWith(inputs.preset, 'vc6') }}
9996
uses: ilammy/msvc-dev-cmd@v1
10097
with:
10198
arch: x86
10299

103-
- name: Setup vcpkg
104-
uses: lukka/run-vcpkg@v11
105-
106-
- name: Configure ${{ inputs.game }} with CMake Using ${{ inputs.preset }}${{ inputs.tools && '+t' || '' }}${{ inputs.extras && '+e' || '' }} Preset
100+
- name: Configure ${{ inputs.game }} with CMake Using ${{ inputs.preset }}
107101
shell: pwsh
108102
run: |
109103
$buildFlags = @(
110-
"-DRTS_BUILD_ZEROHOUR=${{ inputs.game == 'GeneralsMD' && 'ON' || 'OFF' }}",
111-
"-DRTS_BUILD_GENERALS=${{ inputs.game == 'Generals' && 'ON' || 'OFF' }}"
104+
"-DRTS_BUILD_ZEROHOUR=${{ inputs.game == 'GeneralsMD' && 'ON' || 'OFF' }}",
105+
"-DRTS_BUILD_GENERALS=${{ inputs.game == 'Generals' && 'ON' || 'OFF' }}"
112106
)
113-
114107
$gamePrefix = "${{ inputs.game == 'Generals' && 'GENERALS' || 'ZEROHOUR' }}"
115108
$buildFlags += "-DRTS_BUILD_CORE_TOOLS=${{ inputs.tools && 'ON' || 'OFF' }}"
116109
$buildFlags += "-DRTS_BUILD_${gamePrefix}_TOOLS=${{ inputs.tools && 'ON' || 'OFF' }}"
117110
$buildFlags += "-DRTS_BUILD_CORE_EXTRAS=${{ inputs.extras && 'ON' || 'OFF' }}"
118111
$buildFlags += "-DRTS_BUILD_${gamePrefix}_EXTRAS=${{ inputs.extras && 'ON' || 'OFF' }}"
119-
120112
Write-Host "Build flags: $($buildFlags -join ' | ')"
121-
122113
cmake --preset ${{ inputs.preset }} $buildFlags
123114
124-
- name: Build ${{ inputs.game }} with CMake Using ${{ inputs.preset }}${{ inputs.tools && '+t' || '' }}${{ inputs.extras && '+e' || '' }} Preset
115+
# Loop over configs: Debug, Release, RelWithDebInfo
116+
- name: Build ${{ inputs.game }} (Debug)
125117
shell: pwsh
126-
run: |
127-
cmake --build --preset ${{ inputs.preset }}
118+
run: cmake --build build/${{ inputs.preset }} --config Debug
128119

129-
- name: Collect ${{ inputs.game }} ${{ inputs.preset }}${{ inputs.tools && '+t' || '' }}${{ inputs.extras && '+e' || '' }} Artifact
120+
- name: Build ${{ inputs.game }} (Release)
130121
shell: pwsh
131-
run: |
132-
$buildDir = "build\${{ inputs.preset }}"
133-
$artifactsDir = New-Item -ItemType Directory -Force -Path "$buildDir\${{ inputs.game }}\artifacts" -Verbose
122+
run: cmake --build build/${{ inputs.preset }} --config Release
134123

135-
if ("${{ inputs.preset }}" -like "win32*") {
136-
# For win32 preset, look in config-specific subdirectories
137-
$configToUse = if ("${{ inputs.preset }}" -match "debug") { "Debug" } else { "Release" }
138-
$files = Get-ChildItem -Path "$buildDir\Core\$configToUse","$buildDir\${{ inputs.game }}\$configToUse" -File | Where-Object { $_.Extension -in @(".exe", ".dll", ".pdb") } -Verbose
139-
} else {
140-
$files = Get-ChildItem -Path "$buildDir\Core","$buildDir\${{ inputs.game }}" -File | Where-Object { $_.Extension -in @(".exe", ".dll", ".pdb") } -Verbose
141-
}
142-
$files | Move-Item -Destination $artifactsDir -Verbose -Force
124+
- name: Build ${{ inputs.game }} (RelWithDebInfo)
125+
shell: pwsh
126+
run: cmake --build build/${{ inputs.preset }} --config RelWithDebInfo
143127

144-
- name: Upload ${{ inputs.game }} ${{ inputs.preset }}${{ inputs.tools && '+t' || '' }}${{ inputs.extras && '+e' || '' }} Artifact
145-
uses: actions/upload-artifact@v4
146-
with:
147-
name: ${{ inputs.game }}-${{ inputs.preset }}${{ inputs.tools && '+t' || '' }}${{ inputs.extras && '+e' || '' }}
148-
path: build\${{ inputs.preset }}\${{ inputs.game }}\artifacts
149-
retention-days: 30
150-
if-no-files-found: error
128+
# (Optional: Collect/Upload artifacts logic goes here if you want to keep per-config builds)

.github/workflows/ci.yml

Lines changed: 4 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -63,34 +63,12 @@ jobs:
6363
strategy:
6464
matrix:
6565
include:
66-
- preset: "vc6"
66+
- preset: "ninja"
6767
tools: true
6868
extras: true
69-
- preset: "vc6-profile"
69+
- preset: "ninja-vc6"
7070
tools: true
7171
extras: true
72-
- preset: "vc6-debug"
73-
tools: true
74-
extras: true
75-
- preset: "win32"
76-
tools: true
77-
extras: true
78-
- preset: "win32-profile"
79-
tools: true
80-
extras: true
81-
- preset: "win32-debug"
82-
tools: true
83-
extras: true
84-
# vcpkg builds have been disabled for now due to excessive build times of 30 minutes per preset
85-
# - preset: "win32-vcpkg"
86-
# tools: true
87-
# extras: true
88-
# - preset: "win32-vcpkg-profile"
89-
# tools: true
90-
# extras: true
91-
# - preset: "win32-vcpkg-debug"
92-
# tools: true
93-
# extras: true
9472
fail-fast: false
9573
uses: ./.github/workflows/build-toolchain.yml
9674
with:
@@ -107,34 +85,12 @@ jobs:
10785
strategy:
10886
matrix:
10987
include:
110-
- preset: "vc6"
111-
tools: true
112-
extras: true
113-
- preset: "vc6-profile"
114-
tools: true
115-
extras: true
116-
- preset: "vc6-debug"
117-
tools: true
118-
extras: true
119-
- preset: "win32"
120-
tools: true
121-
extras: true
122-
- preset: "win32-profile"
88+
- preset: "ninja"
12389
tools: true
12490
extras: true
125-
- preset: "win32-debug"
91+
- preset: "ninja-vc6"
12692
tools: true
12793
extras: true
128-
# vcpkg builds have been disabled for now due to excessive build times of 30 minutes per preset
129-
# - preset: "win32-vcpkg"
130-
# tools: true
131-
# extras: true
132-
# - preset: "win32-vcpkg-profile"
133-
# tools: true
134-
# extras: true
135-
# - preset: "win32-vcpkg-debug"
136-
# tools: true
137-
# extras: true
13894
fail-fast: false
13995
uses: ./.github/workflows/build-toolchain.yml
14096
with:

0 commit comments

Comments
 (0)