Skip to content

Commit b2458fe

Browse files
committed
feat(build): changes for fbraz3 versioning system
1 parent dd2bb78 commit b2458fe

File tree

15 files changed

+648
-118
lines changed

15 files changed

+648
-118
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.10.1

.github/workflows/build-toolchain.yml

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,22 @@ on:
2525
default: false
2626
type: boolean
2727
description: "Build extras"
28+
release:
29+
required: false
30+
type: string
31+
description: "Release name to stamp binaries"
32+
build_user:
33+
required: false
34+
type: string
35+
description: "Override VERSION_BUILDUSER"
36+
build_loc:
37+
required: false
38+
type: string
39+
description: "Override VERSION_BUILDLOC"
40+
build_num:
41+
required: false
42+
type: string
43+
description: "Override VERSION_BUILDNUM"
2844

2945
jobs:
3046
build:
@@ -41,10 +57,10 @@ jobs:
4157
uses: actions/cache@v4
4258
with:
4359
path: C:\VC6
44-
key: vc6-permanent-cache-v2
60+
key: vc6-permanent-cache-v3
4561

4662
- name: Cache CMake Dependencies
47-
id: cache-cmake-deps
63+
id: cache-cmake-deps-v2
4864
uses: actions/cache@v4
4965
with:
5066
path: build\${{ inputs.preset }}\_deps
@@ -110,6 +126,22 @@ jobs:
110126
"-DRTS_BUILD_GENERALS=${{ inputs.game == 'Generals' && 'ON' || 'OFF' }}"
111127
)
112128
129+
if ("${{ inputs.release }}") {
130+
$buildFlags += "-DRELEASE_NAME:STRING=${{ inputs.release }}"
131+
}
132+
133+
if ("${{ inputs.build_user }}") {
134+
$buildFlags += "-DVERSION_BUILDUSER:STRING=${{ inputs.build_user }}"
135+
}
136+
137+
if ("${{ inputs.build_loc }}") {
138+
$buildFlags += "-DVERSION_BUILDLOC:STRING=${{ inputs.build_loc }}"
139+
}
140+
141+
if ("${{ inputs.build_num }}") {
142+
$buildFlags += "-DVERSION_BUILDNUM:INT=${{ inputs.build_num }}"
143+
}
144+
113145
$gamePrefix = "${{ inputs.game == 'Generals' && 'GENERALS' || 'ZEROHOUR' }}"
114146
$buildFlags += "-DRTS_BUILD_CORE_TOOLS=${{ inputs.tools && 'ON' || 'OFF' }}"
115147
$buildFlags += "-DRTS_BUILD_${gamePrefix}_TOOLS=${{ inputs.tools && 'ON' || 'OFF' }}"
@@ -140,6 +172,9 @@ jobs:
140172
}
141173
$files | Move-Item -Destination $artifactsDir -Verbose -Force
142174
175+
Write-Host "Files in artifactsDir:"
176+
Get-ChildItem -Path $artifactsDir | ForEach-Object { Write-Host $_.FullName }
177+
143178
- name: Upload ${{ inputs.game }} ${{ inputs.preset }}${{ inputs.tools && '+t' || '' }}${{ inputs.extras && '+e' || '' }} Artifact
144179
uses: actions/upload-artifact@v4
145180
with:

.github/workflows/ci.yml

Lines changed: 6 additions & 6 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:
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"

.github/workflows/validate-pull-request.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@ permissions:
55
pull-requests: write
66

77
on:
8-
pull_request:
9-
branches:
10-
- main
11-
types:
12-
- opened
13-
- edited
14-
- synchronize
15-
- reopened
8+
# pull_request:
9+
# branches:
10+
# - main
11+
# types:
12+
# - opened
13+
# - edited
14+
# - synchronize
15+
# - reopened
16+
workflow_dispatch:
1617

1718
jobs:
1819
validate-title-and-commits:

0 commit comments

Comments
 (0)