-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate Win32 version string based on build no, git tag or fallback to changelog #1730
Conversation
this file controls how the version strings appears in the final compiled .exe file
these functions can be used to a) extract the version from `CHANGELOG.md` and b) create a .rc2 file from the `sample` template by replacing its content
with this commit, the build script extracts the latest version string found in `CHANGELOG.md`, and then creates appropriate resource files for the executable compilation
@Stanzilla & @MartiUK – ready to merge. |
Not sure about the reading from the changelog part but otherwise super cool! |
@Stanzilla thanks! I thought it was a stable and consistent way to do it. Any other constants to use? |
I'm just wondering if the Can't you take advantage of the inbuilt [version] data type instead of smushing strings together? They won't like words in the version string. Can't github tag the release as a pre-release rather than putting it in the version string? |
So in most of my other projects, nightly version names are generated on the last tag name + a sequential number + a git hash + a release type. See here for example: https://www.wowace.com/projects/weakauras-2/files That would work quite well here as well, I think |
@Stanzilla this is perfect! Notably becauss it also includes a build number. @Jackbennett any ideas how to incorporate this instead of regexing the Changelog? |
@Jackbennett @Stanzilla It seems that using powershell scripts I can use AppVoyer's environment variables and/or the build worker APIs to get variables like the project name, type of compilation (can be used for copyright year), build number from AppVoyer, tag_name (contains version strings) and even whose commit is being built. However, we should also consider the fact that the On the other hand, Should I alter the method to retrieve data from AppVoyer when available and attempt to extract them from |
@Stanzilla Then you'd have to update them on each build. |
@Stanzilla even a better idea! We can use the already existing "git tag" defined in here: Line 51 in bcf8527
It would work if it's a AppVeyor environment, or the repo has been cloned. |
Sounds good |
@Stanzilla please add a commit to the sources/vedor.json, or any .json file and define the following:
I will rewrite my commits to read from that file if AppVeyor or Git is not available. |
meh, do we actually need that? If someone wants to compile without Git present, I don't think that will happen? |
@Stanzilla It's technically possible to download a .zip file archive of the source and launch the build script from it. Currently, this builds a correct archive. If the repo's not cloned using So, my guess is to either block the user from compiling a downloaded .zip file and throwing an error instead, and warn the user not to download a .zip file, or we can add a hardcoded .json with the package version. |
Okay, then how about hardcoding the name in your script since the name will actually never change and fall back "version" to "dev" if git is not present or not on AV |
@Stanzilla the name is already hardcoded:
I can fallback the version string to |
Yes |
@Stanzilla instead of |
Hrm, I guess. What do @cmderdev/trusted-contributors think about the whole thing btw? |
@Stanzilla I implemented and tested the new logic. If all is good, you can merge it now. |
|
@Stanzilla what should change in that? |
Oh I thought that was a mistake, but it's the appveyor build number. Hrm it is at a pretty useless value, too. Just |
Without Any other method to substitute AppVeyor's build number? |
what's win32's problem with |
but v1.3.6-pre1.635 worked? |
@Stanzilla It translates to this: |
meh, just leave it like that then, I guess |
Alright then. BTW @Jackbennett Do you approve? I also used the git tag as you suggested. |
This PR addresses two aspects of the C++ launcher compilations, and fixes #1729.
handling versions
With this PR, upon build time the version string is automatically generated by reading the contents of
CHANGELOG.md
and adjusting a resource file. atm, the Copyright/Company info is hardcoded directly into the template file because I was unsure whether I should've read them from README.me.added manifest
The manifest file handles dpi-awareness (prevents the messagebox becoming blurry) and controls the UAC definitions. (More work needs to be done on the subject of dpi-awareness and switching the dialogs to TaskDialog as discussed in #1726.)