Skip to content

Conversation

@fbraz3
Copy link

@fbraz3 fbraz3 commented May 24, 2025

What this PR does?

This PR complements #1171

Creates a github action to create a weekly release with the latest code changes. It will be scheduled to every moday.

https://github.com/fbraz3/GeneralsGameCode/actions/runs/15689781515
image

It also can be mannualy triggered, and it have parameters to bypass the code changes check to force a new build
image

The release notes also have a changelog with all commits since the last release - for the first release it will be limited to the last 10 commits
image

@xezon xezon requested a review from tintinhamans May 24, 2025 19:14
@xezon xezon added Major Severity: Minor < Major < Critical < Blocker Build Anything related to building, compiling labels May 24, 2025
@xezon
Copy link

xezon commented May 24, 2025

What does this change produce then?

@Skyaero42
Copy link

If these are our 'official' pre-releases then they need to be properly versions.

@fbraz3
Copy link
Author

fbraz3 commented May 24, 2025

If these are our 'official' pre-releases then they need to be properly versions.

I can adjust for a semVer schema if it looks better.

@fbraz3
Copy link
Author

fbraz3 commented May 24, 2025

What does this change produce then?

It will produce zip files weekly with the main executables for generals, worldbuilder and w3dview both for both games.

@Skyaero42
Copy link

If these are our 'official' pre-releases then they need to be properly versions.

I can adjust for a semVer schema if it looks better.

It's not about looking better, it's about having traceability when somebody reports an issue or bug.

@fbraz3 fbraz3 force-pushed the weekly-release branch 4 times, most recently from d248576 to b668cf2 Compare May 25, 2025 18:35
@fbraz3
Copy link
Author

fbraz3 commented May 25, 2025

@xezon @roossienb I’ve just updated the pull request to use semantic versioning.

The version is now based on .github/workflows/base-version.txt and the patch level is incremented automatically at build time.

When the project is ready for a stable release, we just need to update the version file to 1.0.

I ran the workflow on my fork and everything went smoothly:
https://github.com/fbraz3/GeneralsGameCode/actions/runs/15241083502
https://github.com/fbraz3/GeneralsGameCode/releases

image image

@Skyaero42
Copy link

In a discussion with @Mauller he told me that they did nightly builds in which they used the latest commit number as the build number in the application. This makes it easy to track back.

@fbraz3
Copy link
Author

fbraz3 commented Jun 4, 2025

In a discussion with @Mauller he told me that they did nightly builds in which they used the latest commit number as the build number in the application. This makes it easy to track back.

It’s fine to change the logic to whatever is needed. But just need to decide what will be the pattern.

All approaches have its own pros and cons. Using latest commit it’s a good approach but we can get more than one commit in a day, and this would be a problem to track anyway.

What about to mix the approaches like 0.9.{commit_id} or 0.9.{release_date} ?

@Skyaero42
Copy link

I think most important is that the version is also shown in-game (so when you open the options menu, in the bottom).

@fbraz3
Copy link
Author

fbraz3 commented Jun 4, 2025

I think most important is that the version is also shown in-game (so when you open the options menu, in the bottom).

I totally agree with you. But I don’t have enough knowledge in C language. Can you guys help me to do that?

@OmniBlade
Copy link

I don't think it should have a proper version number tag, only official releases should get a version tag and otherwise should show the commit and if the tree was dirty when it was built. Vanilla Conquer uses a GitWatcher cmake module to populate the variables used to configure this file which is then referred to when configuring the version.

@fbraz3 fbraz3 force-pushed the weekly-release branch 5 times, most recently from 09d1dd0 to a801bfb Compare June 10, 2025 00:58
@fbraz3
Copy link
Author

fbraz3 commented Jun 10, 2025

I don't think it should have a proper version number tag, only official releases should get a version tag and otherwise should show the commit and if the tree was dirty when it was built. Vanilla Conquer uses a GitWatcher cmake module to populate the variables used to configure this file which is then referred to when configuring the version.

I think I’m getting close to add the build version to game.

I believe in a few days I will be able to update this pr with the modifications.

@fbraz3
Copy link
Author

fbraz3 commented Jun 12, 2025

@xezon @roossienb @OmniBlade @tintinhamans

I've update the first comment of this PR with the latest changes.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does the version string now look in the game?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to set the following defines:

VERSION_BUILDUSER="The Super Hackers"
VERSION_BUILDLOC="https://github.com/TheSuperHackers/GeneralsGameCode"
VERSION_BUILDNUM=<The number of total builds>

For version number we currently use the Git Revision number which is ok.

The files that are generated for VERSION_BUILDUSER etc probably need updating to:

file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/GeneratedVersion.h
"#pragma once

#ifndef VERSION_BUILDNUM
#define VERSION_BUILDNUM ${BuildNumber}
#endif

#ifndef VERSION_LOCALBUILDNUM
#define VERSION_LOCALBUILDNUM 0
#endif

#ifndef VERSION_BUILDUSER
#define VERSION_BUILDUSER ${BuildUser}
#endif

#ifndef VERSION_BUILDLOC
#define VERSION_BUILDLOC ${BuildLocation}
#endif
"
)

or a variation thereof

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@fbraz3 fbraz3 force-pushed the weekly-release branch 4 times, most recently from 9746f58 to ad803af Compare August 14, 2025 00:43
@fbraz3
Copy link
Author

fbraz3 commented Aug 14, 2025

@xezon , I've made some major changes to the codebase here.


Summary of Changes

The primary modification is how the version string is displayed on the options screen.

  1. For standard CI builds (from feature branches, etc.), the version string format remains unchanged:
    Community Patch ~X by XXXX | exe:xxxxx ini:xxxx Version 1.04

  2. For release or pre-release builds generated by the weekly build process (whether scheduled or manually triggered), the version string will now follow this pattern:
    Community Patch by BUILD_USER release RELEASE_NAME - Version 1.04


How It Works

  • The weekly-release.yml workflow sends release-name, build_user, and build_loc to the build toolchain.
  • Standard CI processes do not send these parameters.
  • The build toolchain treats these values as optional, defaulting to empty strings if they aren't provided.
  • If the parameters are set, the toolchain passes them to CMake.
  • The C++ code then reads these build parameters. If they are not blank, it changes the output string on the options screen accordingly.
image

@fbraz3 fbraz3 requested review from OmniBlade and xezon August 14, 2025 22:00
Copy link

@xezon xezon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs another pass, reverting the string mutations and string presentations in the game. Please try to fit CI strings into the established formats.

Feed the Product Title, Product Version and Product Author from CI.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not ideal. Git Info should be taken as is and not be mutated for other purposes. If new information is added, then it should be explicit with new names and fields.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was previously localized.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think exe and ini must not be omitted here. Both EXE and INI hashes are critical information for Game Client compatibility.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this removed? The purpose of configurable Product information is to allow Mods to override this Product information from Data.

If you want to set a new production version put that into the function:

UnicodeString Version::getUnicodeProductVersion() const
{
	UnicodeString version = getBuildVersion();
	if (version.empty())
		version = getUnicodeGitVersion();
	return version;
}

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this building an entirely new string variant for the CI Build? Instead I think we should feed the existing ProductName, ProductVersion and ProductAuthor from CI. That is what it was made for.

I suggest use the existing framework and fit the CI data in there, with priority over the git/other values. And do not override the git information. Just add new raw information as new fields.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to get a CI build count number here instead of git commit count?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should always be generated as is. No custom mutation of Git data.

Copy link

@OmniBlade OmniBlade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we drop the embedding of information from the CI for now as it is proving controvertial for exactly the best method to do so and just focus on producing weeklies as is from the CI? Embedding alternative build info from the CI can be a separate PR.

@fbraz3
Copy link
Author

fbraz3 commented Sep 2, 2025

Maybe we drop the embedding of information from the CI for now as it is proving controvertial for exactly the best method to do so and just focus on producing weeklies as is from the CI? Embedding alternative build info from the CI can be a separate PR.

No problem to change the pr to only build in this first moment. will change the code and request a new review.

@fbraz3
Copy link
Author

fbraz3 commented Sep 2, 2025

@xezon @OmniBlade Just to start a parallel discussion about the versioning system itself:

In my opinion, the CI pipeline should be the single source of truth for versioning. This aligns with what’s considered best practice in the literature (Continuous Delivery – Humble & Farley, Build Automation – Fowler, and SemVer.org). Version numbers should reflect intentional release decisions, while commit hashes and build metadata are generated automatically. CI is the natural place to bring those together in a consistent way.

If we allow local builds to stamp arbitrary versions (date, hash, etc.), we risk drift: the same code might exist under multiple “versions” depending on who built it. By centralizing version stamping in CI, every official artifact can always be traced back to its exact commit and release tag, without mutating Git metadata. Local builds can still include fallback info (like “dev” or build time) for debugging, but those shouldn’t override what CI assigns.

This approach also gives us governance: only CI-published builds carry an official version identifier. That makes it clear which artifacts are “real releases” versus developer builds, and keeps the history consistent and auditable.

@xezon
Copy link

xezon commented Sep 4, 2025

This is an open source project, so anyone will be able to generate any version information in the game client as he likes. So even if we generate a version in CI, someone can replicate it locally.

We currently build version information locally with a mix of Product Name, Git Author and Commit count. From CI you can set a Product Name, Product Version and Product Author, which is different from what is auto generated.

Example:

Locally Generated: "Community Patch 752 By Mauller"
CI Generated: "Community Patch 0.1.752 By The Super Hackers"

0.1.752 meaning
Major Product Version = 0
Minor Product Version = 1
Commit Count = 752

@fbraz3
Copy link
Author

fbraz3 commented Sep 4, 2025

That’s true for any open source project — anyone can fork the repo and stamp whatever version string they want into their local builds. But that doesn’t reduce the value of CI-generated versioning. The real distinction is not whether the string can be replicated, but whether it represents an official artifact or just a local build.

The real value of CI versioning is giving us a single, consistent scheme for official artifacts. Local builds can still show commit/author info for debugging, but CI builds are what the community can trust as authoritative releases. That separation keeps things clear for both contributors and players.

@fbraz3 fbraz3 force-pushed the weekly-release branch 3 times, most recently from ad6019d to 92d3959 Compare September 10, 2025 01:40
@fbraz3 fbraz3 requested review from OmniBlade and xezon September 10, 2025 01:41
Copy link

@xezon xezon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to see a current example Release based on this workflow?

@fbraz3
Copy link
Author

fbraz3 commented Sep 12, 2025

Is it possible to see a current example Release based on this workflow?

Captura de Tela 2025-09-12 às 16 23 14 Captura de Tela 2025-09-12 às 16 23 46 Captura de Tela 2025-09-12 às 16 28 00 Captura de Tela 2025-09-12 às 16 28 09

@fbraz3 fbraz3 requested a review from xezon September 12, 2025 23:07
@fbraz3
Copy link
Author

fbraz3 commented Sep 19, 2025

@xezon @OmniBlade what is still needed to merge this pr?

Copy link

@OmniBlade OmniBlade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks okay to me now, lets get it merged and if it needs further tweaking so be it.

@xezon xezon changed the title [GITHUB] Add weekly pre-releases workflow for Generals and GeneralsMD ci(release): Add weekly pre-releases workflow for Generals and GeneralsMD Sep 19, 2025
@xezon xezon merged commit 783bdb7 into TheSuperHackers:main Sep 19, 2025
18 checks passed
@fbraz3 fbraz3 deleted the weekly-release branch September 19, 2025 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Build Anything related to building, compiling Major Severity: Minor < Major < Critical < Blocker

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants