From 669a33625fce9d9dd02c54944b66f774bb90674c Mon Sep 17 00:00:00 2001 From: AdamN <7974720+anr2me@users.noreply.github.com> Date: Fri, 11 Jul 2025 07:00:19 +0700 Subject: [PATCH] Don't generate win-version.h if GIT_VERSION doesn't have a valid version. --- .github/workflows/build.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e8dcc99e01..88a58861c7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -60,16 +60,19 @@ jobs: #if: github.ref_type == 'tag' run: | $GIT_VERSION=git describe --always --tags + echo "Num of Valid Tags = ${{ steps.valid-tags.outputs.count }}" echo "Test GitVer = ${{ github.ref_name }} / $GIT_VERSION / ${GITHUB_REF_NAME}" echo "const char *PPSSPP_GIT_VERSION = `"$GIT_VERSION`";" > git-version.cpp echo "#define PPSSPP_GIT_VERSION_NO_UPDATE 1" >> git-version.cpp # Generate Windows/win-version.h too. - $WIN_VERSION_COMMA=$GIT_VERSION -replace '^v', '' -replace '-g[0-9a-f]+$', '' -replace '[-\.]', ',' - echo "Test WinVer = $WIN_VERSION_COMMA" - echo "#define PPSSPP_WIN_VERSION_STRING `"$GIT_VERSION`"" > Windows/win-version.h - echo "#define PPSSPP_WIN_VERSION_COMMA $WIN_VERSION_COMMA" >> Windows/win-version.h - echo "#define PPSSPP_WIN_VERSION_NO_UPDATE 1" >> Windows/win-version.h + if ($GIT_VERSION.StartsWith("v")) { + $WIN_VERSION_COMMA=$GIT_VERSION -replace '^v', '' -replace '-g[0-9a-f]+$', '' -replace '[-\.]', ',' + echo "Test WinVer = $WIN_VERSION_COMMA" + echo "#define PPSSPP_WIN_VERSION_STRING `"$GIT_VERSION`"" > Windows/win-version.h + echo "#define PPSSPP_WIN_VERSION_COMMA $WIN_VERSION_COMMA" >> Windows/win-version.h + echo "#define PPSSPP_WIN_VERSION_NO_UPDATE 1" >> Windows/win-version.h + } - name: Build Windows working-directory: ${{ env.GITHUB_WORKSPACE }}