Skip to content

Commit 1d181e7

Browse files
committed
Merge branch 'main' of https://github.com/TheSuperHackers/GeneralsGameCode into merge_SH
# Conflicts: # Core/GameEngine/Include/Common/GameAudio.h # Core/GameEngine/Include/GameClient/ParticleSys.h # Core/GameEngine/Source/Common/INI/INIAudioEventInfo.cpp # Core/GameEngine/Source/Common/INI/INIMiscAudio.cpp # Core/GameEngineDevice/Include/W3DDevice/GameClient/Module/W3DDependencyCarrierDraw.h # Core/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DDefaultDraw.cpp # Core/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DDependencyCarrierDraw.cpp # Core/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DLaserDraw.cpp # Core/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp # Core/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DOverlordAircraftDraw.cpp # Core/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DOverlordTankDraw.cpp # Core/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DOverlordTruckDraw.cpp # GeneralsMD/Code/GameEngine/CMakeLists.txt # GeneralsMD/Code/GameEngine/Include/Common/ThingTemplate.h # GeneralsMD/Code/GameEngine/Include/Common/Upgrade.h # GeneralsMD/Code/GameEngine/Include/GameClient/FXList.h # GeneralsMD/Code/GameEngine/Include/GameLogic/AI.h # GeneralsMD/Code/GameEngine/Include/GameLogic/AIPathfind.h # GeneralsMD/Code/GameEngine/Include/GameLogic/Damage.h # GeneralsMD/Code/GameEngine/Include/GameLogic/Locomotor.h # GeneralsMD/Code/GameEngine/Include/GameLogic/Module/AIUpdate.h # GeneralsMD/Code/GameEngine/Include/GameLogic/Module/AutoDepositUpdate.h # GeneralsMD/Code/GameEngine/Include/GameLogic/Module/BehaviorModule.h # GeneralsMD/Code/GameEngine/Include/GameLogic/Module/DeployStyleAIUpdate.h # GeneralsMD/Code/GameEngine/Include/GameLogic/Module/LifetimeUpdate.h # GeneralsMD/Code/GameEngine/Include/GameLogic/Module/ParkingPlaceBehavior.h # GeneralsMD/Code/GameEngine/Include/GameLogic/Module/PhysicsUpdate.h # GeneralsMD/Code/GameEngine/Include/GameLogic/Module/StealthUpdate.h # GeneralsMD/Code/GameEngine/Include/GameLogic/Module/StickyBombUpdate.h # GeneralsMD/Code/GameEngine/Include/GameLogic/TerrainLogic.h # GeneralsMD/Code/GameEngine/Include/GameLogic/Weapon.h # GeneralsMD/Code/GameEngine/Include/GameLogic/WeaponSet.h # GeneralsMD/Code/GameEngine/Source/Common/BitFlags.cpp # GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp # GeneralsMD/Code/GameEngine/Source/Common/GlobalData.cpp # GeneralsMD/Code/GameEngine/Source/Common/RTS/Science.cpp # GeneralsMD/Code/GameEngine/Source/Common/RTS/SpecialPower.cpp # GeneralsMD/Code/GameEngine/Source/Common/System/DisabledTypes.cpp # GeneralsMD/Code/GameEngine/Source/Common/System/Upgrade.cpp # GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp # GeneralsMD/Code/GameEngine/Source/GameClient/Drawable.cpp # GeneralsMD/Code/GameEngine/Source/GameClient/FXList.cpp # GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp # GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarPopupDescription.cpp # GeneralsMD/Code/GameEngine/Source/GameClient/RadiusDecal.cpp # GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIGroup.cpp # GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp # GeneralsMD/Code/GameEngine/Source/GameLogic/AI/TurretAI.cpp # GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/DumbProjectileBehavior.cpp # GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/CrateCollide.cpp # GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/VeterancyCrateCollide.cpp # GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/OpenContain.cpp # GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/OverlordContain.cpp # GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Die/CreateCrateDie.cpp # GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Locomotor.cpp # GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp # GeneralsMD/Code/GameEngine/Source/GameLogic/Object/ObjectCreationList.cpp # GeneralsMD/Code/GameEngine/Source/GameLogic/Object/SpecialPower/OCLSpecialPower.cpp # GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp # GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp # GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/MissileAIUpdate.cpp # GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/TransportAIUpdate.cpp # GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/HeightDieUpdate.cpp # GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/LaserUpdate.cpp # GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/PhysicsUpdate.cpp # GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/SpectreGunshipDeploymentUpdate.cpp # GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/WeaponBonusUpdate.cpp # GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Upgrade/CostModifierUpgrade.cpp # GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Upgrade/ExperienceScalarUpgrade.cpp # GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Upgrade/MaxHealthUpgrade.cpp # GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp # GeneralsMD/Code/GameEngine/Source/GameLogic/Object/WeaponSet.cpp # GeneralsMD/Code/GameEngine/Source/GameLogic/System/CrateSystem.cpp # GeneralsMD/Code/GameEngine/Source/GameLogic/System/Damage.cpp # GeneralsMD/Code/GameEngineDevice/CMakeLists.txt # GeneralsMD/Code/Tools/WorldBuilder/src/WHeightMapEdit.cpp
2 parents ac134ab + 2468a44 commit 1d181e7

2,961 files changed

Lines changed: 52204 additions & 75252 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 278 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,278 @@
1+
name: Build Historical
2+
3+
permissions:
4+
contents: write
5+
6+
on:
7+
workflow_dispatch:
8+
inputs:
9+
commit:
10+
description: 'Commit SHA to build'
11+
required: true
12+
type: string
13+
pull_requests:
14+
description: 'PR numbers to cherry-pick (comma-separated, e.g., "545,876")'
15+
required: false
16+
default: ''
17+
type: string
18+
game:
19+
description: 'Game to build'
20+
required: true
21+
default: 'GeneralsMD'
22+
type: choice
23+
options:
24+
- 'Generals'
25+
- 'GeneralsMD'
26+
- 'Both'
27+
create_release:
28+
description: 'Create a GitHub release'
29+
required: false
30+
default: 'true'
31+
type: choice
32+
options:
33+
- 'true'
34+
- 'false'
35+
36+
concurrency:
37+
group: ${{ github.workflow }}-${{ github.event.inputs.commit }}
38+
cancel-in-progress: false
39+
40+
jobs:
41+
prepare:
42+
name: Prepare Build Info
43+
runs-on: ubuntu-latest
44+
outputs:
45+
short_sha: ${{ steps.info.outputs.short_sha }}
46+
commit_date: ${{ steps.info.outputs.commit_date }}
47+
commit_subject: ${{ steps.info.outputs.commit_subject }}
48+
release_tag: ${{ steps.info.outputs.release_tag }}
49+
steps:
50+
- name: Checkout Code
51+
uses: actions/checkout@v4
52+
with:
53+
fetch-depth: 0
54+
fetch-tags: true
55+
56+
- name: Gather Commit Info
57+
id: info
58+
run: |
59+
COMMIT="${{ github.event.inputs.commit }}"
60+
61+
if ! git cat-file -e "$COMMIT^{commit}" 2>/dev/null; then
62+
echo "::error::Commit $COMMIT not found in repository"
63+
exit 1
64+
fi
65+
66+
SHORT_SHA=$(git rev-parse --short=7 "$COMMIT")
67+
COMMIT_DATE=$(git show -s --format=%cs "$COMMIT")
68+
COMMIT_SUBJECT=$(git show -s --format=%s "$COMMIT" | head -c 80)
69+
70+
PR_SUFFIX=""
71+
if [ -n "${{ github.event.inputs.pull_requests }}" ]; then
72+
PR_SUFFIX="+pr${{ github.event.inputs.pull_requests }}"
73+
fi
74+
RELEASE_TAG="historical-${COMMIT_DATE}-${SHORT_SHA}${PR_SUFFIX}"
75+
76+
echo "short_sha=$SHORT_SHA" >> $GITHUB_OUTPUT
77+
echo "commit_date=$COMMIT_DATE" >> $GITHUB_OUTPUT
78+
echo "commit_subject=$COMMIT_SUBJECT" >> $GITHUB_OUTPUT
79+
echo "release_tag=$RELEASE_TAG" >> $GITHUB_OUTPUT
80+
81+
echo "### Build Info" >> $GITHUB_STEP_SUMMARY
82+
echo "- Commit: \`$COMMIT\` ($SHORT_SHA)" >> $GITHUB_STEP_SUMMARY
83+
echo "- Date: $COMMIT_DATE" >> $GITHUB_STEP_SUMMARY
84+
echo "- Subject: $COMMIT_SUBJECT" >> $GITHUB_STEP_SUMMARY
85+
echo "- PRs to apply: ${{ github.event.inputs.pull_requests || 'none' }}" >> $GITHUB_STEP_SUMMARY
86+
echo "- Release tag: $RELEASE_TAG" >> $GITHUB_STEP_SUMMARY
87+
88+
build:
89+
name: Build ${{ matrix.game }} vc6
90+
needs: prepare
91+
runs-on: windows-2022
92+
timeout-minutes: 30
93+
strategy:
94+
matrix:
95+
game: ${{ github.event.inputs.game == 'Both' && fromJson('["Generals", "GeneralsMD"]') || fromJson(format('["{0}"]', github.event.inputs.game)) }}
96+
fail-fast: false
97+
98+
steps:
99+
- name: Checkout Target Commit
100+
uses: actions/checkout@v4
101+
with:
102+
ref: ${{ github.event.inputs.commit }}
103+
fetch-depth: 0
104+
105+
- name: Apply Pull Requests
106+
if: ${{ github.event.inputs.pull_requests != '' }}
107+
shell: bash
108+
run: |
109+
git config user.name "GitHub Actions"
110+
git config user.email "actions@github.com"
111+
112+
PR_LIST="${{ github.event.inputs.pull_requests }}"
113+
IFS=',' read -ra PRS <<< "$PR_LIST"
114+
115+
for PR in "${PRS[@]}"; do
116+
PR=$(echo "$PR" | xargs)
117+
echo "::group::Applying PR #$PR"
118+
119+
git fetch origin "pull/$PR/head:pr-$PR"
120+
121+
PR_BASE=$(git merge-base pr-$PR HEAD)
122+
PR_COMMITS=$(git rev-list --reverse "$PR_BASE..pr-$PR")
123+
124+
for COMMIT in $PR_COMMITS; do
125+
echo "Cherry-picking $COMMIT"
126+
if ! git cherry-pick --no-commit "$COMMIT"; then
127+
echo "::error::Failed to cherry-pick commit $COMMIT from PR #$PR"
128+
git cherry-pick --abort || true
129+
exit 1
130+
fi
131+
done
132+
133+
git commit -m "Apply PR #$PR" || echo "No changes to commit for PR #$PR"
134+
echo "::endgroup::"
135+
done
136+
137+
- name: Cache VC6 Installation
138+
id: cache-vc6
139+
uses: actions/cache@v4
140+
with:
141+
path: C:\VC6
142+
key: vc6-permanent-cache-v2
143+
144+
- name: Download VC6 Portable
145+
if: ${{ steps.cache-vc6.outputs.cache-hit != 'true' }}
146+
env:
147+
EXPECTED_HASH: "D0EE1F6DCEF7DB3AD703120D9FB4FAD49EBCA28F44372E40550348B1C00CA583"
148+
VC6_COMMIT: "001c4bafdcf2ef4b474d693acccd35a91e848f40"
149+
shell: pwsh
150+
run: |
151+
Invoke-WebRequest -Uri https://github.com/itsmattkc/MSVC600/archive/$env:VC6_COMMIT.zip -OutFile VS6_VisualStudio6.zip
152+
153+
$fileHash = (Get-FileHash -Path VS6_VisualStudio6.zip -Algorithm SHA256).Hash
154+
if ($fileHash -ne $env:EXPECTED_HASH) {
155+
Write-Error "Hash verification failed!"
156+
exit 1
157+
}
158+
159+
Expand-Archive -Path VS6_VisualStudio6.zip -DestinationPath C:\VC6
160+
Move-Item -Path C:\VC6\MSVC600-$env:VC6_COMMIT -Destination C:\VC6\VC6SP6
161+
Remove-Item VS6_VisualStudio6.zip
162+
163+
- name: Set Up VC6 Environment
164+
shell: pwsh
165+
run: |
166+
$VSCommonDir = "C:\VC6\VC6SP6\Common"
167+
$MSDevDir = "C:\VC6\VC6SP6\Common\msdev98"
168+
$MSVCDir = "C:\VC6\VC6SP6\VC98"
169+
$VcOsDir = "WINNT"
170+
171+
"VSCommonDir=$VSCommonDir" >> $env:GITHUB_ENV
172+
"MSDevDir=$MSDevDir" >> $env:GITHUB_ENV
173+
"MSVCDir=$MSVCDir" >> $env:GITHUB_ENV
174+
"VcOsDir=$VcOsDir" >> $env:GITHUB_ENV
175+
"PATH=$MSDevDir\BIN;$MSVCDir\BIN;$VSCommonDir\TOOLS\$VcOsDir;$VSCommonDir\TOOLS;$env:PATH" >> $env:GITHUB_ENV
176+
"INCLUDE=$MSVCDir\ATL\INCLUDE;$MSVCDir\INCLUDE;$MSVCDir\MFC\INCLUDE;$env:INCLUDE" >> $env:GITHUB_ENV
177+
"LIB=$MSVCDir\LIB;$MSVCDir\MFC\LIB;$env:LIB" >> $env:GITHUB_ENV
178+
179+
- name: Configure with CMake
180+
shell: pwsh
181+
run: |
182+
$buildFlags = @(
183+
"-DRTS_BUILD_ZEROHOUR=${{ matrix.game == 'GeneralsMD' && 'ON' || 'OFF' }}",
184+
"-DRTS_BUILD_GENERALS=${{ matrix.game == 'Generals' && 'ON' || 'OFF' }}",
185+
"-DRTS_BUILD_CORE_TOOLS=ON",
186+
"-DRTS_BUILD_${{ matrix.game == 'Generals' && 'GENERALS' || 'ZEROHOUR' }}_TOOLS=ON"
187+
)
188+
cmake --preset vc6 $buildFlags
189+
190+
- name: Build with CMake
191+
shell: pwsh
192+
run: |
193+
cmake --build --preset vc6
194+
195+
- name: Collect Artifacts
196+
shell: pwsh
197+
run: |
198+
$buildDir = "build\vc6"
199+
$artifactsDir = New-Item -ItemType Directory -Force -Path "$buildDir\${{ matrix.game }}\artifacts"
200+
201+
$files = Get-ChildItem -Path "$buildDir\Core","$buildDir\${{ matrix.game }}" -File |
202+
Where-Object { $_.Extension -in @(".exe", ".dll", ".pdb") }
203+
204+
$files | Move-Item -Destination $artifactsDir -Force
205+
206+
- name: Upload Artifact
207+
uses: actions/upload-artifact@v4
208+
with:
209+
name: ${{ matrix.game }}-vc6-${{ needs.prepare.outputs.short_sha }}
210+
path: build\vc6\${{ matrix.game }}\artifacts
211+
retention-days: 90
212+
213+
create-release:
214+
name: Create Release
215+
needs: [prepare, build]
216+
if: ${{ github.event.inputs.create_release == 'true' }}
217+
runs-on: ubuntu-latest
218+
steps:
219+
- name: Download Generals Artifact
220+
if: ${{ github.event.inputs.game == 'Generals' || github.event.inputs.game == 'Both' }}
221+
uses: actions/download-artifact@v4
222+
with:
223+
name: Generals-vc6-${{ needs.prepare.outputs.short_sha }}
224+
path: generals-artifacts
225+
226+
- name: Download GeneralsMD Artifact
227+
if: ${{ github.event.inputs.game == 'GeneralsMD' || github.event.inputs.game == 'Both' }}
228+
uses: actions/download-artifact@v4
229+
with:
230+
name: GeneralsMD-vc6-${{ needs.prepare.outputs.short_sha }}
231+
path: generalsmd-artifacts
232+
233+
- name: Prepare Release Archives
234+
run: |
235+
if [ -d "generals-artifacts" ]; then
236+
zip -jr generals-${{ needs.prepare.outputs.release_tag }}.zip generals-artifacts/*
237+
fi
238+
if [ -d "generalsmd-artifacts" ]; then
239+
zip -jr generalszh-${{ needs.prepare.outputs.release_tag }}.zip generalsmd-artifacts/*
240+
fi
241+
242+
- name: Generate Release Notes
243+
id: notes
244+
run: |
245+
BODY="## Historical Build
246+
247+
**Commit:** \`${{ github.event.inputs.commit }}\`
248+
**Date:** ${{ needs.prepare.outputs.commit_date }}
249+
**Subject:** ${{ needs.prepare.outputs.commit_subject }}"
250+
251+
if [ -n "${{ github.event.inputs.pull_requests }}" ]; then
252+
BODY="${BODY}
253+
254+
**Applied PRs:** ${{ github.event.inputs.pull_requests }}"
255+
fi
256+
257+
BODY="${BODY}
258+
259+
---
260+
*Built for replay compatibility testing.*"
261+
262+
echo "body<<EOF" >> $GITHUB_OUTPUT
263+
echo "$BODY" >> $GITHUB_OUTPUT
264+
echo "EOF" >> $GITHUB_OUTPUT
265+
266+
- name: Create GitHub Release
267+
uses: softprops/action-gh-release@v2
268+
with:
269+
tag_name: ${{ needs.prepare.outputs.release_tag }}
270+
name: ${{ needs.prepare.outputs.release_tag }}
271+
prerelease: true
272+
body: ${{ steps.notes.outputs.body }}
273+
files: |
274+
generals-${{ needs.prepare.outputs.release_tag }}.zip
275+
generalszh-${{ needs.prepare.outputs.release_tag }}.zip
276+
fail_on_unmatched_files: false
277+
env:
278+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)