This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a commit to branch v4
in repository https://gitbox.apache.org/repos/asf/maven-gh-actions-shared.git


The following commit(s) were added to refs/heads/v4 by this push:
     new 40e3e9b  Fix GnuPG PATH on Windows for Gpg4win 5.x
40e3e9b is described below

commit 40e3e9b15d6bac436692c133b5fc7833b98c3271
Author: Sylwester Lachiewicz <[email protected]>
AuthorDate: Mon Jul 13 17:11:07 2026 +0200

    Fix GnuPG PATH on Windows for Gpg4win 5.x
    
    Chocolatey now installs Gpg4win 5.x, which is 64-bit and deploys GnuPG
    to "C:\Program Files\GnuPG" instead of "C:\Program Files (x86)\GnuPG"
    (Gpg4win 4.x, 32-bit). The hardcoded (x86) path no longer exists, so the
    installed native GnuPG never ends up on PATH and gpg resolves to the
    MSYS build bundled with Git for Windows. That gpg treats Windows-style
    absolute paths (D:\a\...) passed via --homedir as relative POSIX paths,
    which breaks every signing build on windows-latest, e.g. in
    maven-gpg-plugin:
    
      gpg: keyblock resource 
'/d/a/.../it/no-main-artifact/D:\a\...\gnupg/pubring.kbx': No such file or 
directory
      gpg: signing failed: No secret key
    
    Add whichever GnuPG bin directory actually exists to GITHUB_PATH so both
    Gpg4win 4.x and 5.x layouts work.
    
    Co-Authored-By: Claude Fable 5 <[email protected]>
---
 .github/workflows/maven-verify.yml | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/maven-verify.yml 
b/.github/workflows/maven-verify.yml
index fd01ea3..6a99966 100644
--- a/.github/workflows/maven-verify.yml
+++ b/.github/workflows/maven-verify.yml
@@ -406,7 +406,10 @@ jobs:
           $env:PATH = 
"C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\ProgramData\chocolatey\bin"
           [Environment]::SetEnvironmentVariable("Path", $env:PATH, "Machine")
           choco install --yes gpg4win
-          echo "C:\Program Files (x86)\Gpg4win\..\GnuPG\bin" >> 
$env:GITHUB_PATH
+          # Gpg4win 4.x (32-bit) deploys GnuPG under "Program Files (x86)", 
5.x+ (64-bit) under "Program Files"
+          "C:\Program Files\GnuPG\bin", "C:\Program Files (x86)\GnuPG\bin" |
+            Where-Object { Test-Path $_ } |
+            Add-Content $env:GITHUB_PATH
 
       - name: Check GnuPG
         if: >

Reply via email to