From 706dc86a94e82a4ec67ba3a6b4a07ef5bd1d9950 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sat, 7 Oct 2023 13:15:50 +1000 Subject: [PATCH] scmversion: Use annotated tag as base --- scripts/generate-metainfo.sh | 2 +- src/scmversion/gen_scmversion.bat | 4 ++-- src/scmversion/gen_scmversion.sh | 2 +- src/scmversion/update_rc_version.bat | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/generate-metainfo.sh b/scripts/generate-metainfo.sh index 57bd847f5..fbb3cc1e5 100755 --- a/scripts/generate-metainfo.sh +++ b/scripts/generate-metainfo.sh @@ -17,7 +17,7 @@ GIT_VERSION=$(git tag --points-at HEAD) GIT_HASH=$(git rev-parse HEAD) if [[ "${GIT_VERSION}" == "" ]]; then - GIT_VERSION=$(git describe --tags --dirty --exclude latest --exclude preview --exclude legacy --exclude previous-latest | tr -d '\r\n') + GIT_VERSION=$(git describe --dirty | tr -d '\r\n') if [[ "${GIT_VERSION}" == "" ]]; then GIT_VERSION=$(git rev-parse HEAD) fi diff --git a/src/scmversion/gen_scmversion.bat b/src/scmversion/gen_scmversion.bat index 388cd0a80..007a93887 100644 --- a/src/scmversion/gen_scmversion.bat +++ b/src/scmversion/gen_scmversion.bat @@ -3,7 +3,7 @@ SET VERSIONFILE="scmversion.cpp" FOR /F "tokens=* USEBACKQ" %%g IN (`git rev-parse HEAD`) do (SET "HASH=%%g") FOR /F "tokens=* USEBACKQ" %%g IN (`git rev-parse --abbrev-ref HEAD`) do (SET "BRANCH=%%g") -FOR /F "tokens=* USEBACKQ" %%g IN (`git describe --tags --dirty --exclude latest --exclude preview --exclude legacy --exclude previous-latest`) do (SET "TAG=%%g") +FOR /F "tokens=* USEBACKQ" %%g IN (`git describe --dirty`) do (SET "TAG=%%g") FOR /F "tokens=* USEBACKQ" %%g IN (`git log -1 --date=iso8601-strict "--format=%%cd"`) do (SET "CDATE=%%g") SET SIGNATURELINE=// %HASH% %BRANCH% %TAG% %CDATE% @@ -14,7 +14,7 @@ IF "%EXISTINGLINE%"=="%SIGNATURELINE%" ( EXIT ) -ECHO Updating %VERSIONFILE%... +ECHO Updating %VERSIONFILE% with %TAG%... (ECHO %SIGNATURELINE% ECHO const char* g_scm_hash_str = "%HASH%"; diff --git a/src/scmversion/gen_scmversion.sh b/src/scmversion/gen_scmversion.sh index 9c1dacaba..9122cd8bb 100755 --- a/src/scmversion/gen_scmversion.sh +++ b/src/scmversion/gen_scmversion.sh @@ -12,7 +12,7 @@ fi HASH=$(git rev-parse HEAD) BRANCH=$(git rev-parse --abbrev-ref HEAD | tr -d '\r\n') -TAG=$(git describe --tags --dirty --exclude latest --exclude preview --exclude legacy --exclude previous-latest | tr -d '\r\n') +TAG=$(git describe --dirty | tr -d '\r\n') DATE=$(git log -1 --date=iso8601-strict --format=%cd) cd $CURDIR diff --git a/src/scmversion/update_rc_version.bat b/src/scmversion/update_rc_version.bat index 3a1099f2d..e83f989d9 100644 --- a/src/scmversion/update_rc_version.bat +++ b/src/scmversion/update_rc_version.bat @@ -1,6 +1,6 @@ @echo off -FOR /F "tokens=* USEBACKQ" %%g IN (`git describe --tags --dirty --exclude latest --exclude preview --exclude legacy --exclude play-store-release`) do (SET "TAG=%%g") +FOR /F "tokens=* USEBACKQ" %%g IN (`git describe --dirty`) do (SET "TAG=%%g") powershell -Command "(gc ..\duckstation-qt\duckstation-qt.rc) -replace '1,0,0,1', '"%TAG:~0,1%","%TAG:~2,1%","%TAG:~4,4%",0' | Out-File -encoding ASCII ..\duckstation-qt\duckstation-qt.rc" powershell -Command "(gc ..\duckstation-qt\duckstation-qt.rc) -replace '1.0.0.1', '"%TAG:~0,1%"."%TAG:~2,1%"."%TAG:~4,4%"' | Out-File -encoding ASCII ..\duckstation-qt\duckstation-qt.rc"