]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
GHA/windows: add support for built-in OpenSSH-Windows
authorViktor Szakats <commit@vsz.me>
Sun, 13 Apr 2025 10:01:00 +0000 (12:01 +0200)
committerViktor Szakats <commit@vsz.me>
Sun, 13 Apr 2025 22:05:17 +0000 (00:05 +0200)
On the windows-2022 runner it installs these client/server versions:
```
ssh client found /c/Windows/System32/OpenSSH/ssh.exe is OpenSSH-Windows 9.5.0
ssh server found /c/Windows/System32/OpenSSH/sshd.exe is OpenSSH-Windows 8.1.0
```

Not currently enabled. Slight downside (when enabled) that Windows needs
over 1 minute to install these two tiny programs.

Closes #17046

.github/workflows/windows.yml

index 36f7c5a4fc628015fb9b21fd37555c64bfcda023..76c5eb19d56d4cd4cf122a4515f44a0c7c45b463 100644 (file)
@@ -933,6 +933,10 @@ jobs:
         run: |
           if [ '${{ matrix.openssh }}' = '' ]; then  # MSYS2 openssh
             /usr/bin/pacman --noconfirm --noprogressbar --sync --needed openssh
+          elif [ '${{ matrix.openssh }}' = 'OpenSSH-Windows-builtin' ]; then
+            # https://learn.microsoft.com/windows-server/administration/openssh/openssh_install_firstuse
+            pwsh -Command 'Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0'
+            pwsh -Command 'Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0'
           else  # OpenSSH-Windows
             cd /d || exit 1
             curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 \