From daa5a578770a178f226b94058e2af9195b980b70 Mon Sep 17 00:00:00 2001 From: David Newhall II Date: Sun, 30 Aug 2026 01:10:27 -0700 Subject: [PATCH] Keep goversioninfo from opening a missing versioninfo.json. Copilot Autofix removed -skip-versioninfo as a YAML list item, so the release hook failed looking for the default JSON. Put the skip flag on the go run line and ship a zeros JSON as fallback. Co-authored-by: Cursor --- .goreleaser.yaml | 14 ++++++------ init/windows/README.md | 3 ++- init/windows/versioninfo.json | 41 +++++++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 8 deletions(-) create mode 100644 init/windows/versioninfo.json diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 39983a6..9fb5129 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -9,14 +9,13 @@ before: - go run github.com/davidnewhall/md2roff@v0.0.1 --manual xt --version "{{.Version}}-{{.Env.REVISION}}" --date "{{.Date}}" MANUAL.md - rm -f MANUAL.gz - gzip -9 MANUAL - # Icon + manifest + VERSIONINFO (Explorer File version). -platform-specific: - # Windows is amd64/386/arm64; a single amd64 .syso would miss the others. - # FileVersion is the x.y.z prefix of .Version plus REVISION (not .RawVersion: - # that stays on the last tag if --nightly is ever used). ProductVersion is - # .Version. goversioninfo fills the numeric fields from the FileVersion string. + # Icon + manifest + VERSIONINFO. --platform-specific for amd64/386/arm64. + # Keep --skip-versioninfo=true on the go run line so YAML/Copilot cannot + # treat it as a list item. versioninfo.json is the fallback if skip is + # dropped. FileVersion is .Version's x.y.z prefix plus REVISION. + # goversioninfo still downloads akavel/rsrc as a library to write the .syso. - >- - go run github.com/josephspurrier/goversioninfo/cmd/goversioninfo@v1.7.0 - -platform-specific + go run github.com/josephspurrier/goversioninfo/cmd/goversioninfo@v1.7.0 --platform-specific=true --skip-versioninfo=true -icon init/windows/application.ico -manifest init/windows/manifest.xml -company "Go Lift" @@ -29,6 +28,7 @@ before: -product-version "{{ .Version }}" -translation 1033 -charset 1200 + init/windows/versioninfo.json builds: - id: xt diff --git a/init/windows/README.md b/init/windows/README.md index 6bf4634..6f3aea7 100644 --- a/init/windows/README.md +++ b/init/windows/README.md @@ -3,4 +3,5 @@ Windows file icon (Explorer / exe Properties), not a tray icon. `application.ico` is a multi-size ICO (16, 24, 32, 48, 64, 128, 256) of the circular XT emblem from the repo wordmark. `application-256.png` is the same art as a square PNG with a transparent background. GoReleaser embeds the ico -via goversioninfo. +and VERSIONINFO via goversioninfo. `versioninfo.json` is only a fallback if +`-skip-versioninfo` is dropped; CLI flags set the version strings. diff --git a/init/windows/versioninfo.json b/init/windows/versioninfo.json new file mode 100644 index 0000000..4cf5326 --- /dev/null +++ b/init/windows/versioninfo.json @@ -0,0 +1,41 @@ +{ + "FixedFileInfo": { + "FileVersion": { + "Major": 0, + "Minor": 0, + "Patch": 0, + "Build": 0 + }, + "ProductVersion": { + "Major": 0, + "Minor": 0, + "Patch": 0, + "Build": 0 + }, + "FileFlagsMask": "3f", + "FileFlags ": "00", + "FileOS": "040004", + "FileType": "01", + "FileSubType": "00" + }, + "StringFileInfo": { + "Comments": "", + "CompanyName": "Go Lift", + "FileDescription": "eXtractor Tool - Recursively decompress archives", + "FileVersion": "", + "InternalName": "xt", + "LegalCopyright": "© Go Lift (https://golift.io)", + "LegalTrademarks": "", + "OriginalFilename": "xt.exe", + "PrivateBuild": "", + "ProductName": "xt", + "ProductVersion": "", + "SpecialBuild": "" + }, + "VarFileInfo": { + "Translation": { + "LangID": "0409", + "CharsetID": "04B0" + } + } +}