diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 96af21d05d..16fd802e69 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/scripts/build b/scripts/build index fed96357ad..c18f4a2d97 100755 --- a/scripts/build +++ b/scripts/build @@ -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" diff --git a/scripts/setenv b/scripts/setenv index bb47c00a9f..ec4742f2dd 100755 --- a/scripts/setenv +++ b/scripts/setenv @@ -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]+)-.+'