From 3573f74a6dffa660fa5524fafbfd21453873f5f5 Mon Sep 17 00:00:00 2001 From: Harshjeet Patil Date: Thu, 19 Nov 2026 12:26:01 +0530 Subject: [PATCH 1/4] Embed Windows version info in cx.exe so publisher shows Checkmarx (AST-193772) Co-Authored-By: Claude Sonnet 5.5 --- .gitignore | 5 ++++- .goreleaser-dev.yml | 7 ++++++- .goreleaser.yml | 7 ++++++- Makefile | 7 +++++-- cmd/winres/winres.json | 22 ++++++++++++++++++++++ 5 files changed, 43 insertions(+), 5 deletions(-) create mode 100644 cmd/winres/winres.json diff --git a/.gitignore b/.gitignore index f77686f22..6afc3f2a0 100644 --- a/.gitignore +++ b/.gitignore @@ -66,4 +66,7 @@ override.tf.json vendor/* # Build artifacts and temporary directories -internal/commands/data/manifests/obj/ \ No newline at end of file +internal/commands/data/manifests/obj/ + +# Generated Windows version resource +cmd/*.syso diff --git a/.goreleaser-dev.yml b/.goreleaser-dev.yml index 1ba2f93ce..f1b15463f 100644 --- a/.goreleaser-dev.yml +++ b/.goreleaser-dev.yml @@ -5,8 +5,13 @@ release: name_template: 'Checkmarx One CLI {{.Version}}' disable: true +before: + hooks: + # embed Windows version info so the firewall/Explorer show Checkmarx as publisher + - go run github.com/tc-hib/go-winres@v0.3.3 make --in cmd/winres/winres.json --out cmd/rsrc --arch amd64 --file-version {{ .Major }}.{{ .Minor }}.{{ .Patch }}.0 --product-version {{ .Major }}.{{ .Minor }}.{{ .Patch }}.0 + builds: - - main: ./cmd/main.go + - main: ./cmd env: - CGO_ENABLED=0 binary: cx diff --git a/.goreleaser.yml b/.goreleaser.yml index b1595d6f9..043e166dd 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -4,8 +4,13 @@ release: name_template: 'Checkmarx One CLI {{.Version}}' disable: true +before: + hooks: + # embed Windows version info so the firewall/Explorer show Checkmarx as publisher + - go run github.com/tc-hib/go-winres@v0.3.3 make --in cmd/winres/winres.json --out cmd/rsrc --arch amd64 --file-version {{ .Major }}.{{ .Minor }}.{{ .Patch }}.0 --product-version {{ .Major }}.{{ .Minor }}.{{ .Patch }}.0 + builds: - - main: ./cmd/main.go + - main: ./cmd env: - CGO_ENABLED=0 binary: cx diff --git a/Makefile b/Makefile index d1db47d8d..480e44180 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,14 @@ .DEFAULT_GOAL := vet -.PHONY:fmt vet build lint +.PHONY:fmt vet build lint winres fmt: go fmt ./... vet: fmt go vet ./... -build: vet +winres: + go run github.com/tc-hib/go-winres@v0.3.3 make --in cmd/winres/winres.json --out cmd/rsrc --arch amd64 --file-version 0.0.0.0 --product-version 0.0.0.0 + +build: vet winres go build -o bin/cx.exe ./cmd lint: fmt golangci-lint run -c .golangci.yml \ No newline at end of file diff --git a/cmd/winres/winres.json b/cmd/winres/winres.json new file mode 100644 index 000000000..d7004844b --- /dev/null +++ b/cmd/winres/winres.json @@ -0,0 +1,22 @@ +{ + "RT_VERSION": { + "#1": { + "0000": { + "fixed": { + "file_version": "0.0.0.0", + "product_version": "0.0.0.0" + }, + "info": { + "0409": { + "CompanyName": "Checkmarx", + "FileDescription": "Checkmarx One CLI", + "InternalName": "cx", + "LegalCopyright": "Copyright (c) Checkmarx Ltd.", + "OriginalFilename": "cx.exe", + "ProductName": "Checkmarx One CLI" + } + } + } + } + } +} From ce7e56624568505fa146d7dc8631aad6c15f216e Mon Sep 17 00:00:00 2001 From: Harshjeet Patil Date: Thu, 19 Nov 2026 13:45:22 +0530 Subject: [PATCH 2/4] Commit prebuilt Windows version resources; drop release-time go-winres hook (AST-193772) Co-Authored-By: Claude Sonnet 5.5 --- .gitignore | 5 +---- .goreleaser-dev.yml | 5 ----- .goreleaser.yml | 5 ----- Makefile | 10 +++++----- cmd/rsrc_windows_386.syso | Bin 0 -> 892 bytes cmd/rsrc_windows_amd64.syso | Bin 0 -> 892 bytes cmd/rsrc_windows_arm64.syso | Bin 0 -> 892 bytes cmd/winres/winres.json | 4 +++- 8 files changed, 9 insertions(+), 20 deletions(-) create mode 100644 cmd/rsrc_windows_386.syso create mode 100644 cmd/rsrc_windows_amd64.syso create mode 100644 cmd/rsrc_windows_arm64.syso diff --git a/.gitignore b/.gitignore index 6afc3f2a0..f77686f22 100644 --- a/.gitignore +++ b/.gitignore @@ -66,7 +66,4 @@ override.tf.json vendor/* # Build artifacts and temporary directories -internal/commands/data/manifests/obj/ - -# Generated Windows version resource -cmd/*.syso +internal/commands/data/manifests/obj/ \ No newline at end of file diff --git a/.goreleaser-dev.yml b/.goreleaser-dev.yml index f1b15463f..3c85e7a0a 100644 --- a/.goreleaser-dev.yml +++ b/.goreleaser-dev.yml @@ -5,11 +5,6 @@ release: name_template: 'Checkmarx One CLI {{.Version}}' disable: true -before: - hooks: - # embed Windows version info so the firewall/Explorer show Checkmarx as publisher - - go run github.com/tc-hib/go-winres@v0.3.3 make --in cmd/winres/winres.json --out cmd/rsrc --arch amd64 --file-version {{ .Major }}.{{ .Minor }}.{{ .Patch }}.0 --product-version {{ .Major }}.{{ .Minor }}.{{ .Patch }}.0 - builds: - main: ./cmd env: diff --git a/.goreleaser.yml b/.goreleaser.yml index 043e166dd..f8cd73175 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -4,11 +4,6 @@ release: name_template: 'Checkmarx One CLI {{.Version}}' disable: true -before: - hooks: - # embed Windows version info so the firewall/Explorer show Checkmarx as publisher - - go run github.com/tc-hib/go-winres@v0.3.3 make --in cmd/winres/winres.json --out cmd/rsrc --arch amd64 --file-version {{ .Major }}.{{ .Minor }}.{{ .Patch }}.0 --product-version {{ .Major }}.{{ .Minor }}.{{ .Patch }}.0 - builds: - main: ./cmd env: diff --git a/Makefile b/Makefile index 480e44180..e6b7d8b63 100644 --- a/Makefile +++ b/Makefile @@ -5,10 +5,10 @@ fmt: go fmt ./... vet: fmt go vet ./... -winres: - go run github.com/tc-hib/go-winres@v0.3.3 make --in cmd/winres/winres.json --out cmd/rsrc --arch amd64 --file-version 0.0.0.0 --product-version 0.0.0.0 - -build: vet winres +build: vet go build -o bin/cx.exe ./cmd lint: fmt - golangci-lint run -c .golangci.yml \ No newline at end of file + golangci-lint run -c .golangci.yml +# regenerate the committed Windows version resources (only needed when cmd/winres/winres.json changes) +winres: + go run github.com/tc-hib/go-winres@v0.3.3 make --in cmd/winres/winres.json --out cmd/rsrc --arch amd64,386,arm64 diff --git a/cmd/rsrc_windows_386.syso b/cmd/rsrc_windows_386.syso new file mode 100644 index 0000000000000000000000000000000000000000..bcf30abfb48925fde7722b2277f759efb30fba59 GIT binary patch literal 892 zcmZ{j!AiqG5QhJ>fvP9*TLYG_~r`-JPBN_n&{Jo6z%Q)+tMwC)JW+(st2o3OL)sy<{~r+>ZO%E;mn$xXaRO z9?4eE;p>0I=Y8n_&;{e8RNVR~HQ2OtrfcRso#GwpSV!y+nfLL{-u=(7LbVIIX?yJY z@+URrr&aQJ@TE%BQ>-p*J@s`5bF7Y@4CpX*HB{FoqoEsSu`Y183Fc7)Mc`jh6S2E< z^iAF4we>(Gf`3Fb)Dm~{9J`zkL0Ikq8hUWW|J)6zG6o-zF+`ovFgL~3;w*u!;Hawx zCLhwO%HXZ8)L~;(^`{iKokHnKE8s#fU5Bs=2h?UNyVR7D`*$qR8kMX&eY153u%)_1 zi`j-M@E?!)tm~#D?}_cQ4w{}CDn<;mUDvx4?mfZvOty4Ny=nTLceZB@*R!7-vz;q? yX1%k#_C{LhN+v3&UWcl@E9sn5djmsiiBMMj5A*(;0o>cRwesVOvahG?7`_23Gi{3i literal 0 HcmV?d00001 diff --git a/cmd/rsrc_windows_amd64.syso b/cmd/rsrc_windows_amd64.syso new file mode 100644 index 0000000000000000000000000000000000000000..c789292f7c2d6554abde1b83f89b9b4c01e007a3 GIT binary patch literal 892 zcmZ{j&q@MO6vjWDf&Q$bRhwWI615Q*5(Ghk773D3AuXaX|0UTd;{>*A)${ZM?R=l! zAo`ta)0o!5d+)jDe)l`yIo@f#W@Og!q^T$6qfyj!(diU$wvT(wYG$}Y_p@DM8Li=N zNH0lbx@H`{@JD>bmrej(F(%pc)+AeGQ`d!VnU8diS5Zx;>?_R2_-60^$7ibAh1_)T z?fUY6YD!LXo|xJ7%%2a<>HLQA0JrKcl9> zuI=bcy2oqkfk*@XG102lxs&85b3OuLxrb=z!4>{V$^n8Lm2K5o{?( zL3uFAkhbK3x4L474N=vfQQUM2r5kO6tAgn|gjG1CHdEQ9rkLD|u|V5Yvg7p4*B!tX ztA!S`T`j?1`{uK*n~tO>wwrd)^yE=7W|);-@6Nb4fa{5D@r-)Yw3v6kXGPbu-yHLu zOM7O$v%L03>gbAoRL;B(<#<=pC8zcVM%2KG;?#GU7H=4lCc zMS9I5>FPOr<&XG+FC788V0;$xTc3q0o2Jfm&3vF!yqX$1W?y4I#5eo!zrJ(TF65@2 zk?YGJ*OZ->$m7A6C{|CAy0G>1pf=2rI(jmo!&FpNMO%!jZkWZo$lX0KkLoJ~|ALy3 zUE9&`=?<@@dmFXXopWk$U_dP)%JTnV!GAY^d)u}aetl8)^%Nb$56Y}= AM*si- literal 0 HcmV?d00001 diff --git a/cmd/winres/winres.json b/cmd/winres/winres.json index d7004844b..7fd0d6a2f 100644 --- a/cmd/winres/winres.json +++ b/cmd/winres/winres.json @@ -10,10 +10,12 @@ "0409": { "CompanyName": "Checkmarx", "FileDescription": "Checkmarx One CLI", + "FileVersion": "0.0.0.0", "InternalName": "cx", "LegalCopyright": "Copyright (c) Checkmarx Ltd.", "OriginalFilename": "cx.exe", - "ProductName": "Checkmarx One CLI" + "ProductName": "Checkmarx One CLI", + "ProductVersion": "0.0.0.0" } } } From 53dd2cfff9cb529e102109a898731a813554cf9d Mon Sep 17 00:00:00 2001 From: Harshjeet Patil Date: Thu, 19 Nov 2026 14:32:33 +0530 Subject: [PATCH 3/4] Build all release targets from ./cmd for uniform builds (AST-193772) Co-Authored-By: Claude Sonnet 5.5 --- .goreleaser-dev.yml | 2 +- .goreleaser.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.goreleaser-dev.yml b/.goreleaser-dev.yml index 3c85e7a0a..49278a4ea 100644 --- a/.goreleaser-dev.yml +++ b/.goreleaser-dev.yml @@ -43,7 +43,7 @@ builds: # - SIGNING_HSM_CREDS={{ .Env.SIGNING_HSM_CREDS }} # - SIGNING_REMOTE_SSH_PRIVATE_KEY={{ .Env.SIGNING_REMOTE_SSH_PRIVATE_KEY }} - - main: ./cmd/main.go + - main: ./cmd env: - CGO_ENABLED=0 binary: cx diff --git a/.goreleaser.yml b/.goreleaser.yml index f8cd73175..4eb8b4e0e 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -42,7 +42,7 @@ builds: # - SIGNING_HSM_CREDS={{ .Env.SIGNING_HSM_CREDS }} # - SIGNING_REMOTE_SSH_PRIVATE_KEY={{ .Env.SIGNING_REMOTE_SSH_PRIVATE_KEY }} - - main: ./cmd/main.go + - main: ./cmd env: - CGO_ENABLED=0 binary: cx From 7d6c4788e70ee6c3d28d59a90050e03a460cebaf Mon Sep 17 00:00:00 2001 From: Harshjeet Patil Date: Thu, 19 Nov 2026 16:46:50 +0530 Subject: [PATCH 4/4] Show 0.0.0 version text and add CI check for Windows version resources (AST-193772) Co-Authored-By: Claude Sonnet 5.5 --- .github/workflows/winres-check.yml | 51 +++++++++++++++++++++++++++++ cmd/rsrc_windows_386.syso | Bin 892 -> 884 bytes cmd/rsrc_windows_amd64.syso | Bin 892 -> 884 bytes cmd/rsrc_windows_arm64.syso | Bin 892 -> 884 bytes cmd/winres/winres.json | 4 +-- 5 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/winres-check.yml diff --git a/.github/workflows/winres-check.yml b/.github/workflows/winres-check.yml new file mode 100644 index 000000000..f15e29939 --- /dev/null +++ b/.github/workflows/winres-check.yml @@ -0,0 +1,51 @@ +name: Windows Version Resource Check + +on: + pull_request: + paths: + - 'cmd/**' + - '.github/workflows/winres-check.yml' + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + winres-check: + name: Verify Windows version resource + runs-on: cx-public-ubuntu-x64 + steps: + - name: Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v6 + with: + persist-credentials: false + + - name: Setup Go + uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 #v4 + with: + go-version-file: go.mod + + # committed .syso files must match what winres.json generates + - name: Committed resources match winres.json + run: | + tmp="$(mktemp -d)" + go run github.com/tc-hib/go-winres@v0.3.3 make --in cmd/winres/winres.json --out "$tmp/rsrc" --arch amd64,386,arm64 + for a in amd64 386 arm64; do + cmp "$tmp/rsrc_windows_$a.syso" "cmd/rsrc_windows_$a.syso" \ + || { echo "::error::cmd/rsrc_windows_$a.syso is out of date, run 'make winres' and commit"; exit 1; } + done + + # the built Windows exe must carry the publisher info + - name: Built Windows binaries carry Checkmarx version info + run: | + tmp="$(mktemp -d)" + for a in amd64 386 arm64; do + CGO_ENABLED=0 GOOS=windows GOARCH=$a go build -o "$tmp/cx_$a.exe" ./cmd + for s in "Checkmarx" "Checkmarx One CLI"; do + strings -el "$tmp/cx_$a.exe" | grep -qx "$s" \ + || { echo "::error::windows/$a build is missing version info '$s'"; exit 1; } + done + done diff --git a/cmd/rsrc_windows_386.syso b/cmd/rsrc_windows_386.syso index bcf30abfb48925fde7722b2277f759efb30fba59..b58aa16ccc89267993191abca8a6f2e91a1d7dd1 100644 GIT binary patch delta 84 zcmeyv_Jxhphmny11mY%gN^?puGcecyIUy5uqj~o*fhEAio{3YV8D%DZRA&0YI9ZHw e8nX@q+vN3(>YHydvN19n06CADv?mKOX8{1foDy3A delta 84 zcmeyu_J@trhmny11kxsQN^>eOGcecyIWZG;qj`@ofhEAik%?2I8C52JRAypenk>dR djoE;KWAb`N_05+Uxfq#EfSmhG+LPIs^8l?75s&}? diff --git a/cmd/rsrc_windows_amd64.syso b/cmd/rsrc_windows_amd64.syso index c789292f7c2d6554abde1b83f89b9b4c01e007a3..737d6d3f33a48fced7d6cbc3a89fafae1d750e83 100644 GIT binary patch delta 84 zcmeyv_JxfzrHzpR1mY%gN^?puGcecyIUy5uqj~o*fhEAio{3YV8D%DZRA&0YI9ZHw e8nX@q+vN3(>YHydvN19n06CADv?mKOX8{24iW2w$ delta 84 zcmeyu_J@r#rHzpR1kxsQN^>eOGcecyIWZG;qj`@ofhEAik%?2I8C52JRAypenk>dR djoE;KWAb`N_05+Uxfq#EfSmhG+LPIs^8nob5-k7# diff --git a/cmd/rsrc_windows_arm64.syso b/cmd/rsrc_windows_arm64.syso index 38998dd65271b52ede75ee98c0e82f558b0b7a15..f75b8cfaddd1152b64a64a9eccd7a4ff8756e740 100644 GIT binary patch delta 84 zcmeyv_JxfzWfda>2*gd~l;)IRW?--ZazZBRM)U4r0!x62Jrk!!Gs;Z-sLb?(ak3cW eG-e$Jw#n-m)i>W_WMgDD0CFBPX-^hn&H@1Yf)gA7 delta 84 zcmeyu_J@r#Wfda>2&7Hql;%`mW?--Za$+XxM)MwF0!x62BNL}aGpbDdsLaH`G+B&s e8nXcd$K>^l>YFbyaxpTS06F)Wv?sGM=K%oc_7YJ5 diff --git a/cmd/winres/winres.json b/cmd/winres/winres.json index 7fd0d6a2f..128454e93 100644 --- a/cmd/winres/winres.json +++ b/cmd/winres/winres.json @@ -10,12 +10,12 @@ "0409": { "CompanyName": "Checkmarx", "FileDescription": "Checkmarx One CLI", - "FileVersion": "0.0.0.0", + "FileVersion": "0.0.0", "InternalName": "cx", "LegalCopyright": "Copyright (c) Checkmarx Ltd.", "OriginalFilename": "cx.exe", "ProductName": "Checkmarx One CLI", - "ProductVersion": "0.0.0.0" + "ProductVersion": "0.0.0" } } }