Prepare release candidates

We'll use "-rcX" instead of "-pre" to allow multiple ones, jic
Additionally, they will be able to be detected using __RGBDS_RC__
Finally, adapt everything version-related to this new system
This commit is contained in:
ISSOtm
2021-03-10 00:06:32 +01:00
parent e141da1d94
commit 028e7af7d1
5 changed files with 16 additions and 3 deletions

View File

@@ -86,7 +86,7 @@ jobs:
Once that's done, replace this text with the changelog, un-draft the release, and update the `release` branch. Once that's done, replace this text with the changelog, un-draft the release, and update the `release` branch.
By the way, if you forgot to update `include/version.h`, RGBASM's version test is gonna fail in the tag's regression testing! (Use `git push --delete origin <tag>` to delete it) By the way, if you forgot to update `include/version.h`, RGBASM's version test is gonna fail in the tag's regression testing! (Use `git push --delete origin <tag>` to delete it)
draft: true # Don't publish the release quite yet... draft: true # Don't publish the release quite yet...
prerelease: ${{ endsWith(github.ref, '-pre') }} prerelease: ${{ contains(github.ref, '-rc') }}
files: | files: |
rgbds-${{ env.version }}-win32.zip rgbds-${{ env.version }}-win32.zip
rgbds-${{ env.version }}-win64.zip rgbds-${{ env.version }}-win64.zip

View File

@@ -12,6 +12,7 @@
#define PACKAGE_VERSION_MAJOR 0 #define PACKAGE_VERSION_MAJOR 0
#define PACKAGE_VERSION_MINOR 4 #define PACKAGE_VERSION_MINOR 4
#define PACKAGE_VERSION_PATCH 2 #define PACKAGE_VERSION_PATCH 2
// #define PACKAGE_VERSION_RC 1
const char *get_package_version_string(void); const char *get_package_version_string(void);

View File

@@ -1215,6 +1215,7 @@ The following symbols are defined by the assembler:
.It Dv __RGBDS_MAJOR__ Ta Ic EQU Ta Major version number of RGBDS .It Dv __RGBDS_MAJOR__ Ta Ic EQU Ta Major version number of RGBDS
.It Dv __RGBDS_MINOR__ Ta Ic EQU Ta Minor version number of RGBDS .It Dv __RGBDS_MINOR__ Ta Ic EQU Ta Minor version number of RGBDS
.It Dv __RGBDS_PATCH__ Ta Ic EQU Ta Patch version number of RGBDS .It Dv __RGBDS_PATCH__ Ta Ic EQU Ta Patch version number of RGBDS
.It Dv __RGBDS_RC__ Ta Ic EQU Ta Release candidate ID of RGBDS, not defined for final releases
.El .El
.Pp .Pp
The current time values will be taken from the The current time values will be taken from the

View File

@@ -17,9 +17,16 @@ const char *get_package_version_string(void)
// The following conditional should be simplified by the compiler. // The following conditional should be simplified by the compiler.
if (strlen(BUILD_VERSION_STRING) == 0) { if (strlen(BUILD_VERSION_STRING) == 0) {
// Fallback if version string can't be obtained from Git // Fallback if version string can't be obtained from Git
#ifndef PACKAGE_VERSION_RC
return "v" EXPAND_AND_STR(PACKAGE_VERSION_MAJOR) return "v" EXPAND_AND_STR(PACKAGE_VERSION_MAJOR)
"." EXPAND_AND_STR(PACKAGE_VERSION_MINOR) "." EXPAND_AND_STR(PACKAGE_VERSION_MINOR)
"." EXPAND_AND_STR(PACKAGE_VERSION_PATCH); "." EXPAND_AND_STR(PACKAGE_VERSION_PATCH);
#else
return "v" EXPAND_AND_STR(PACKAGE_VERSION_MAJOR)
"." EXPAND_AND_STR(PACKAGE_VERSION_MINOR)
"." EXPAND_AND_STR(PACKAGE_VERSION_PATCH)
"-rc" EXPAND_AND_STR(PACKAGE_VERSION_RC);
#endif
} else { } else {
return BUILD_VERSION_STRING; return BUILD_VERSION_STRING;
} }

View File

@@ -39,7 +39,11 @@ tryCmp () {
# Add the version constants test, outputting the closest tag to the HEAD # Add the version constants test, outputting the closest tag to the HEAD
if git describe --tags --abbrev=0 > version.out; then if git describe --tags --abbrev=0 > version.out; then
cat > version.asm <<EOF cat > version.asm <<EOF
IF !DEF(__RGBDS_RC__)
PRINTLN "v{d:__RGBDS_MAJOR__}.{d:__RGBDS_MINOR__}.{d:__RGBDS_PATCH__}" PRINTLN "v{d:__RGBDS_MAJOR__}.{d:__RGBDS_MINOR__}.{d:__RGBDS_PATCH__}"
ELSE
PRINTLN "v{d:__RGBDS_MAJOR__}.{d:__RGBDS_MINOR__}.{d:__RGBDS_PATCH__}-rc{d:__RGBDS_RC__}"
ENDC
EOF EOF
else else
echo "${bold}${orange}Warning: cannot run version test!${rescolors}${resbold}" echo "${bold}${orange}Warning: cannot run version test!${rescolors}${resbold}"