diff --git a/.github/workflows/create-release-artifacts.yaml b/.github/workflows/create-release-artifacts.yaml index b3145e7d..d0cc4593 100644 --- a/.github/workflows/create-release-artifacts.yaml +++ b/.github/workflows/create-release-artifacts.yaml @@ -86,7 +86,7 @@ jobs: 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 ` to delete it) draft: true # Don't publish the release quite yet... - prerelease: ${{ endsWith(github.ref, '-pre') }} + prerelease: ${{ contains(github.ref, '-rc') }} files: | rgbds-${{ env.version }}-win32.zip rgbds-${{ env.version }}-win64.zip diff --git a/include/version.h b/include/version.h index 8359f239..3b4437ce 100644 --- a/include/version.h +++ b/include/version.h @@ -12,6 +12,7 @@ #define PACKAGE_VERSION_MAJOR 0 #define PACKAGE_VERSION_MINOR 4 #define PACKAGE_VERSION_PATCH 2 +// #define PACKAGE_VERSION_RC 1 const char *get_package_version_string(void); diff --git a/src/asm/rgbasm.5 b/src/asm/rgbasm.5 index 837f0932..0834d72f 100644 --- a/src/asm/rgbasm.5 +++ b/src/asm/rgbasm.5 @@ -855,7 +855,7 @@ are allowed exclusively in labels, as described below. A symbol cannot have the same name as a reserved keyword. .Pp Constants and string equates -.Em must not +.Em must not have any whitespace before their name when they are defined; otherwise .Nm @@ -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_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_RC__ Ta Ic EQU Ta Release candidate ID of RGBDS, not defined for final releases .El .Pp The current time values will be taken from the diff --git a/src/version.c b/src/version.c index 0f716e01..d3bdaed2 100644 --- a/src/version.c +++ b/src/version.c @@ -17,9 +17,16 @@ const char *get_package_version_string(void) // The following conditional should be simplified by the compiler. if (strlen(BUILD_VERSION_STRING) == 0) { // Fallback if version string can't be obtained from Git +#ifndef PACKAGE_VERSION_RC return "v" EXPAND_AND_STR(PACKAGE_VERSION_MAJOR) "." EXPAND_AND_STR(PACKAGE_VERSION_MINOR) "." 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 { return BUILD_VERSION_STRING; } diff --git a/test/asm/test.sh b/test/asm/test.sh index 6d13fc54..98ffcfa6 100755 --- a/test/asm/test.sh +++ b/test/asm/test.sh @@ -39,7 +39,11 @@ tryCmp () { # Add the version constants test, outputting the closest tag to the HEAD if git describe --tags --abbrev=0 > version.out; then cat > version.asm <