diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3dac613b1c..17a5c28cdc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,6 +41,25 @@ jobs: - name: Add MSBuild to PATH uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce # v2.0.0 + - name: Fetch tags + # This is required for git describe --always to work for git-version.cpp. + run: git fetch --deepen=15000 --no-recurse-submodules --tags || exit 0 + + - name: Create git-version.cpp for Windows # Not sure why the one at git-version-gen.cmd couldn't get the version properly. + #if: github.ref_type == 'tag' + run: | + $GIT_VERSION=git describe --always --tags + 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 + - name: Build Windows working-directory: ${{ env.GITHUB_WORKSPACE }} run: msbuild /m /p:TrackFileAccess=false /p:Configuration=${{ env.BUILD_CONFIGURATION }} /p:Platform=${{ matrix.platform }} Windows/PPSSPP.sln