Skip to content

Commit

Permalink
scmversion: Use annotated tag as base
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed Oct 7, 2023
1 parent 61a5efe commit 706dc86
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion scripts/generate-metainfo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/scmversion/gen_scmversion.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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%
Expand All @@ -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%";
Expand Down
2 changes: 1 addition & 1 deletion src/scmversion/gen_scmversion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/scmversion/update_rc_version.bat
Original file line number Diff line number Diff line change
@@ -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"
Expand Down

0 comments on commit 706dc86

Please sign in to comment.