From e6b6ff6325302ca855454d6bc4cb120e9d33361c Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sat, 23 Oct 2021 23:50:11 +1000 Subject: [PATCH 1/2] Revert "Add version number to the Windows executable" This reverts commit b0cd59e5fb421c4f2d11e34b241f1b7e4857004a. --- src/scmversion/gen_scmversion.bat | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/scmversion/gen_scmversion.bat b/src/scmversion/gen_scmversion.bat index fee16fa8a..bc2c42f63 100644 --- a/src/scmversion/gen_scmversion.bat +++ b/src/scmversion/gen_scmversion.bat @@ -23,11 +23,5 @@ ECHO const char* g_scm_tag_str = "%TAG%"; ECHO const char* g_scm_date_str = "%CDATE%"; )>%VERSIONFILE% -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" - -powershell -Command "(gc ..\duckstation-nogui\duckstation-nogui.rc) -replace '1,0,0,1', '"%TAG:~0,1%","%TAG:~2,1%","%TAG:~4,4%",0' | Out-File -encoding ASCII ..\duckstation-nogui\duckstation-nogui.rc -powershell -Command "(gc ..\duckstation-nogui\duckstation-nogui.rc) -replace '1.0.0.1', '"%TAG:~0,1%"."%TAG:~2,1%"."%TAG:~4,4%"' | Out-File -encoding ASCII ..\duckstation-nogui\duckstation-nogui.rc" - EXIT From 134f7d6e544c46b753986ee425bc88edf07347b7 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sun, 24 Oct 2021 00:10:47 +1000 Subject: [PATCH 2/2] CI: Set version in rc files at build time --- .github/workflows/rolling-release.yml | 17 +++++++++++++++++ src/scmversion/update_rc_version.bat | 9 +++++++++ 2 files changed, 26 insertions(+) create mode 100644 src/scmversion/update_rc_version.bat diff --git a/.github/workflows/rolling-release.yml b/.github/workflows/rolling-release.yml index d767526ac..33f46deda 100644 --- a/.github/workflows/rolling-release.yml +++ b/.github/workflows/rolling-release.yml @@ -46,6 +46,15 @@ jobs: echo #define SCM_RELEASE_TAGS {"latest", "preview"} >> src/scmversion/tag.h echo #define SCM_RELEASE_TAG "latest" >> src/scmversion/tag.h + - name: Update RC version fields + shell: cmd + run: | + cd src\scmversion + call update_rc_version.bat + cd ..\.. + git update-index --assume-unchanged src/duckstation-qt/duckstation-qt.rc + git update-index --assume-unchanged src/duckstation-nogui/duckstation-nogui.rc + - name: Compile x64 release build shell: cmd run: | @@ -108,6 +117,14 @@ jobs: echo #define SCM_RELEASE_TAGS {"latest", "preview"} >> src/scmversion/tag.h echo #define SCM_RELEASE_TAG "latest" >> src/scmversion/tag.h + - name: Update RC version fields + shell: cmd + run: | + cd src\scmversion + call update_rc_version.bat + cd ..\.. + git update-index --assume-unchanged src/duckstation-qt/duckstation-qt.rc + git update-index --assume-unchanged src/duckstation-nogui/duckstation-nogui.rc - name: Compile arm64 release build shell: cmd diff --git a/src/scmversion/update_rc_version.bat b/src/scmversion/update_rc_version.bat new file mode 100644 index 000000000..76aa528eb --- /dev/null +++ b/src/scmversion/update_rc_version.bat @@ -0,0 +1,9 @@ +@echo off + +FOR /F "tokens=* USEBACKQ" %%g IN (`git describe --tags --dirty --exclude latest --exclude preview --exclude play-store-release`) 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" + +powershell -Command "(gc ..\duckstation-nogui\duckstation-nogui.rc) -replace '1,0,0,1', '"%TAG:~0,1%","%TAG:~2,1%","%TAG:~4,4%",0' | Out-File -encoding ASCII ..\duckstation-nogui\duckstation-nogui.rc +powershell -Command "(gc ..\duckstation-nogui\duckstation-nogui.rc) -replace '1.0.0.1', '"%TAG:~0,1%"."%TAG:~2,1%"."%TAG:~4,4%"' | Out-File -encoding ASCII ..\duckstation-nogui\duckstation-nogui.rc" \ No newline at end of file