From 2b173841f59402b1d3f5abdfb818369bd72537a3 Mon Sep 17 00:00:00 2001 From: Evan Hu Date: Sat, 5 Sep 2026 16:37:32 +0900 Subject: [PATCH] fix(ci): verify the version resource at the source, not on the built DLL The release build failed at "Verify the stamped version" on both architectures. Stamping worked, the log shows "Stamped 0.0.10.0 into src\IME\MetasequoiaIME.rc (4 fields)", but reading the DLL back gave an empty string. The VERSIONINFO block in src/IME/MetasequoiaIME.rc is named IDR_VERSION2, which is not defined in resource.h or anywhere else, rather than the VS_VERSION_INFO that GetFileVersionInfo looks for. So the DLL has never carried a version Windows can read, and the check asserted something the binary could never satisfy. Stamping now runs apply_version.py followed by --check, which verifies the resource actually matches version.txt. The step on the built artifact is reduced to confirming the DLL the installer collects exists. Making the version readable would mean renaming the resource to VS_VERSION_INFO, which changes what the shipped DLL exposes, so it is left alone here. --- .github/workflows/release.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b2236aea..d097e528 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -106,9 +106,15 @@ jobs: submodules: recursive persist-credentials: false + # Verifying the built DLL instead would not work: the VERSIONINFO block in + # src/IME/MetasequoiaIME.rc is named IDR_VERSION2, which is not defined anywhere, rather + # than the VS_VERSION_INFO the Windows version API looks for. GetFileVersionInfo therefore + # finds nothing and the DLL reports an empty FileVersion, which has always been the case. - name: Stamp the version resource shell: pwsh - run: python scripts/apply_version.py + run: | + python scripts/apply_version.py + python scripts/apply_version.py --check - name: Install dependencies shell: pwsh @@ -128,17 +134,12 @@ jobs: shell: pwsh run: cmake --build ${{ matrix.build_dir }} --config Release --parallel - - name: Verify the stamped version + - name: Check the DLL the installer expects shell: pwsh - env: - EXPECTED: ${{ needs.prepare.outputs.version }} run: | $dll = "${{ matrix.build_dir }}/Release/MetasequoiaImeTsf.dll" - $actual = (Get-Item $dll).VersionInfo.FileVersion - Write-Host "$dll reports $actual" - if ($actual -notlike "$env:EXPECTED*") { - throw "Expected the DLL to report $env:EXPECTED, got $actual" - } + if (-not (Test-Path $dll)) { throw "The build did not produce $dll" } + Write-Host "$dll is $((Get-Item $dll).Length) bytes" - name: Upload the DLL uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2