Merge pull request #17022 from Broxzier/bugfix/missing-version-info

This commit is contained in:
Hielke Morsink 2022-04-21 22:22:17 +02:00 committed by GitHub
commit 0377b2c002
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 1 deletions

View File

@ -66,6 +66,11 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Git describe for shallow checkout
id: ghd
uses: proudust/gh-describe@v1
- name: Update GA environment
run: echo "OPENRCT2_DESCRIBE=${{ steps.ghd.outputs.describe }}" >> $GITHUB_ENV
- name: Install MSVC problem matcher
uses: ammaraskar/msvc-problem-matcher@master
- name: Build OpenRCT2

View File

@ -17,6 +17,8 @@ if [[ "$OSTYPE" == "cygwin" || "$OSTYPE" == "msys" ]]; then
fileversion=$OPENRCT2_VERSION.$OPENRCT2_BUILD
productversion="$fileversion-${OPENRCT2_SHA1_SHORT}"
fileversion=${fileversion//./,}
# FILEVERSION in the resource file can only take up to 4 digits in the version string, so we remove the surplus of version numbers
fileversion=$(echo $fileversion | cut -f1-4 -d",")
echo "#define OPENRCT2_FILE_VERSION $fileversion" > "resources/version.h"
echo "#define OPENRCT2_PRODUCT_VERSION \"$productversion\"" >> "resources/version.h"
cat "resources/version.h"

View File

@ -14,7 +14,6 @@ fi
echo -e "\033[0;36mSetting up environment for OpenRCT2...\033[0m"
# Get the build number (number of commits since last tag)
export OPENRCT2_DESCRIBE=$(git describe HEAD)
get_build_number()
{
local pattern='.+-([0-9]+)-.+'