Skip to content

Commit f27541e

Browse files
committed
[GITHUB] Sync Generals repos
1 parent 4c69156 commit f27541e

File tree

6 files changed

+422
-48
lines changed

6 files changed

+422
-48
lines changed

.github/FUNDING.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github: fbraz3
2+
patreon: fbraz3

.github/workflows/base-version.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.9.1

.github/workflows/build-toolchain.yml

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ on:
2525
default: false
2626
type: boolean
2727
description: "Build extras"
28+
release:
29+
required: false
30+
type: string
31+
description: "Release build (true/false)"
2832

2933
jobs:
3034
build:
@@ -41,39 +45,40 @@ jobs:
4145
uses: actions/cache@v4
4246
with:
4347
path: C:\VC6
44-
key: vc6-permanent-cache-v1
45-
46-
- name: Cache CMake Dependencies
47-
id: cache-cmake-deps
48-
uses: actions/cache@v4
49-
with:
50-
path: build\${{ inputs.preset }}\_deps
51-
key: cmake-deps-${{ inputs.preset }}-${{ hashFiles('CMakePresets.json','cmake/**/*.cmake','**/CMakeLists.txt') }}
52-
53-
- name: Download VC6 Portable from Cloudflare R2
48+
key: vc6-permanent-cache-v2
49+
50+
#- name: Cache CMake Dependencies
51+
# id: cache-cmake-deps
52+
# uses: actions/cache@v4
53+
# with:
54+
# path: build\${{ inputs.preset }}\_deps
55+
# key: cmake-deps-${{ inputs.preset }}-${{ hashFiles('cmake/**/*.cmake', '**/CMakeLists.txt') }}
56+
# restore-keys: |
57+
# cmake-deps-${{ inputs.preset }}-
58+
59+
- name: Download VC6 Portable from itsmattkc repo
5460
if: ${{ startsWith(inputs.preset, 'vc6') && steps.cache-vc6.outputs.cache-hit != 'true' }}
5561
env:
56-
AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
57-
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
58-
AWS_ENDPOINT_URL: ${{ secrets.R2_ENDPOINT_URL }}
59-
EXPECTED_HASH: "118D0F1ACBBD70C3F8B081CA4DBAF955FE0C6C359A76636E930AA89FDC551091"
62+
EXPECTED_HASH: "D0EE1F6DCEF7DB3AD703120D9FB4FAD49EBCA28F44372E40550348B1C00CA583"
63+
COMMIT: "001c4bafdcf2ef4b474d693acccd35a91e848f40"
6064
shell: pwsh
6165
run: |
6266
Write-Host "Downloading VC6 Portable Installation" -ForegroundColor Cyan
63-
aws s3 cp s3://github-ci/VS6_VisualStudio6.7z VS6_VisualStudio6.7z --endpoint-url $env:AWS_ENDPOINT_URL
67+
Invoke-WebRequest -Uri https://github.com/itsmattkc/MSVC600/archive/$env:COMMIT.zip -OutFile VS6_VisualStudio6.zip
6468
6569
Write-Host "Verifying File Integrity" -ForegroundColor Cyan
66-
$fileHash = (Get-FileHash -Path VS6_VisualStudio6.7z -Algorithm SHA256).Hash
70+
$fileHash = (Get-FileHash -Path VS6_VisualStudio6.zip -Algorithm SHA256).Hash
6771
Write-Host "Downloaded file SHA256: $fileHash"
6872
Write-Host "Expected file SHA256: $env:EXPECTED_HASH"
69-
if ($hash -ne $env:EXPECTED_HASH) {
73+
if ($fileHash -ne $env:EXPECTED_HASH) {
7074
Write-Error "Hash verification failed! File may be corrupted or tampered with."
7175
exit 1
7276
}
7377
7478
Write-Host "Extracting Archive" -ForegroundColor Cyan
75-
& 7z x VS6_VisualStudio6.7z -oC:\VC6
76-
Remove-Item VS6_VisualStudio6.7z -Verbose
79+
& Expand-Archive -Path VS6_VisualStudio6.zip -DestinationPath C:\VC6
80+
Move-Item -Path C:\VC6\MSVC600-$env:COMMIT -Destination C:\VC6\VC6SP6
81+
Remove-Item VS6_VisualStudio6.zip -Verbose
7782
7883
- name: Set Up VC6 Environment
7984
if: startsWith(inputs.preset, 'vc6')
@@ -110,6 +115,10 @@ jobs:
110115
"-DRTS_BUILD_ZEROHOUR=${{ inputs.game == 'GeneralsMD' && 'ON' || 'OFF' }}",
111116
"-DRTS_BUILD_GENERALS=${{ inputs.game == 'Generals' && 'ON' || 'OFF' }}"
112117
)
118+
119+
if ("${{ inputs.release }}") {
120+
$buildFlags += "-DVERSION_BUILDUSER='${{ inputs.release }}'"
121+
}
113122
114123
$gamePrefix = "${{ inputs.game == 'Generals' && 'GENERALS' || 'ZEROHOUR' }}"
115124
$buildFlags += "-DRTS_BUILD_CORE_TOOLS=${{ inputs.tools && 'ON' || 'OFF' }}"
@@ -140,6 +149,9 @@ jobs:
140149
$files = Get-ChildItem -Path "$buildDir\Core","$buildDir\${{ inputs.game }}" -File | Where-Object { $_.Extension -in @(".exe", ".dll", ".pdb") } -Verbose
141150
}
142151
$files | Move-Item -Destination $artifactsDir -Verbose -Force
152+
153+
Write-Host "Files in artifactsDir:"
154+
Get-ChildItem -Path $artifactsDir | ForEach-Object { Write-Host $_.FullName }
143155
144156
- name: Upload ${{ inputs.game }} ${{ inputs.preset }}${{ inputs.tools && '+t' || '' }}${{ inputs.extras && '+e' || '' }} Artifact
145157
uses: actions/upload-artifact@v4

.github/workflows/ci.yml

Lines changed: 21 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ permissions:
55
pull-requests: write
66

77
on:
8-
push:
9-
branches:
10-
- main
11-
pull_request:
12-
branches:
13-
- main
8+
# push:
9+
# branches:
10+
# - main
11+
# pull_request:
12+
# branches:
13+
# - main
1414
workflow_dispatch:
1515

1616
concurrency:
@@ -69,28 +69,24 @@ jobs:
6969
- preset: "vc6-profile"
7070
tools: true
7171
extras: true
72+
- preset: "vc6-internal"
73+
tools: true
74+
extras: true
7275
- preset: "vc6-debug"
7376
tools: true
7477
extras: true
75-
- preset: "win32"
78+
- preset: "win32-vcpkg"
7679
tools: true
7780
extras: true
78-
- preset: "win32-profile"
81+
- preset: "win32-vcpkg-profile"
7982
tools: true
8083
extras: true
81-
- preset: "win32-debug"
84+
- preset: "win32-vcpkg-internal"
85+
tools: true
86+
extras: true
87+
- preset: "win32-vcpkg-debug"
8288
tools: true
8389
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
9490
fail-fast: false
9591
uses: ./.github/workflows/build-toolchain.yml
9692
with:
@@ -113,6 +109,9 @@ jobs:
113109
- preset: "vc6-profile"
114110
tools: true
115111
extras: true
112+
- preset: "vc6-internal"
113+
tools: true
114+
extras: true
116115
- preset: "vc6-debug"
117116
tools: true
118117
extras: true
@@ -122,19 +121,12 @@ jobs:
122121
- preset: "win32-profile"
123122
tools: true
124123
extras: true
124+
- preset: "win32-internal"
125+
tools: true
126+
extras: true
125127
- preset: "win32-debug"
126128
tools: true
127129
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
138130
fail-fast: false
139131
uses: ./.github/workflows/build-toolchain.yml
140132
with:
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Test notes
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
create-release:
8+
name: Create Release
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout repository
12+
uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 0
15+
fetch-tags: true
16+
17+
- name: Read base version
18+
id: base_version
19+
run: echo "base_version=$(cat .github/workflows/base-version.txt)" >> $GITHUB_OUTPUT
20+
21+
- name: Get latest semver tag
22+
id: get_tag
23+
run: echo "current_tag=$(cat current_tag.txt)" >> $GITHUB_OUTPUT
24+
25+
- name: Calculate next version
26+
id: next_version
27+
run: echo "next_tag=$(cat next_tag.txt)" >> $GITHUB_OUTPUT
28+
29+
- name: Collect commits since last release
30+
id: changelog
31+
run: |
32+
TAG="0.9.2"
33+
NEXT_TAG="0.9.3"
34+
35+
echo "DEBUG: Current Tag (TAG) = $TAG"
36+
echo "DEBUG: Next Tag (NEXT_TAG) = $NEXT_TAG"
37+
38+
CHANGELOG_COMMITS=""
39+
if [ "$TAG" == "$NEXT_TAG" ]; then
40+
echo "DEBUG: Condition TAG == NEXT_TAG. Generating changelog for initial release or no new tag."
41+
CHANGELOG_COMMITS=$(git log --pretty="format:- %s" --no-merges HEAD | grep -v "Sync Generals repos" | head -n 10 || true)
42+
43+
if [ -z "$CHANGELOG_COMMITS" ]; then
44+
echo "DEBUG: Filtered log for initial release was empty. Trying to get the last 5 commits directly."
45+
CHANGELOG_COMMITS=$(git log --pretty="format:- %s" --no-merges HEAD -n 5 || true)
46+
fi
47+
else
48+
echo "DEBUG: Condition TAG != NEXT_TAG. Generating changelog from $TAG to HEAD."
49+
50+
echo "Command:"
51+
echo git log --pretty="format:- %s" --no-merges "$TAG"..HEAD | grep -v "Sync Generals repos" || true
52+
53+
echo "Output:"
54+
git log --pretty="format:- %s" --no-merges "$TAG"..HEAD | grep -v "Sync Generals repos" || true
55+
56+
CHANGELOG_COMMITS=$(git log --pretty="format:- %s" --no-merges "$TAG"..HEAD | grep -v "Sync Generals repos" || true)
57+
fi
58+
59+
echo "--- DEBUG: Output of captured commits ---"
60+
if [ -z "$CHANGELOG_COMMITS" ]; then
61+
echo "No commits found for the changelog."
62+
CHANGELOG_COMMITS="- No relevant changes detected since the last release."
63+
else
64+
echo "$CHANGELOG_COMMITS"
65+
fi
66+
echo "--- END DEBUG ---"
67+
68+
{
69+
echo 'commits<<CHANGELOG_EOF'
70+
echo "$CHANGELOG_COMMITS"
71+
echo 'CHANGELOG_EOF'
72+
} >> "$GITHUB_OUTPUT"

0 commit comments

Comments
 (0)