Skip to content

Commit 35864bb

Browse files
mkschulzeclaude
andcommitted
fix(ci): auto-discover OpenSSL install path on Windows
Chocolatey's OpenSSL 3.6.2 no longer writes the registry key that CMake depends on, so the hardcoded C:/Program Files/OpenSSL-Win64 path fails. Search common install locations and fall back to PATH discovery. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 78b254a commit 35864bb

1 file changed

Lines changed: 29 additions & 1 deletion

File tree

.github/workflows/juce-build.yml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,34 @@ jobs:
138138
- name: Install OpenSSL
139139
run: choco install openssl --no-progress -y
140140

141+
- name: Find OpenSSL
142+
id: openssl
143+
shell: pwsh
144+
run: |
145+
# Chocolatey/SLP installer path varies — search common locations
146+
$candidates = @(
147+
"C:\Program Files\OpenSSL-Win64",
148+
"C:\Program Files\OpenSSL",
149+
"C:\OpenSSL-Win64"
150+
)
151+
foreach ($dir in $candidates) {
152+
if (Test-Path "$dir\include\openssl\ssl.h") {
153+
Write-Host "Found OpenSSL at: $dir"
154+
echo "root=$dir" >> $env:GITHUB_OUTPUT
155+
exit 0
156+
}
157+
}
158+
# Fallback: find from openssl.exe on PATH
159+
$bin = Get-Command openssl -ErrorAction SilentlyContinue
160+
if ($bin) {
161+
$root = Split-Path (Split-Path $bin.Source)
162+
Write-Host "Found OpenSSL via PATH at: $root"
163+
echo "root=$root" >> $env:GITHUB_OUTPUT
164+
exit 0
165+
}
166+
Write-Error "OpenSSL not found"
167+
exit 1
168+
141169
- name: Configure CMake
142170
run: |
143171
cmake -B build `
@@ -146,7 +174,7 @@ jobs:
146174
-DJAMWIDE_BUILD_JUCE=ON `
147175
-DJAMWIDE_BUILD_CLAP=OFF `
148176
-DJAMWIDE_DEV_BUILD=OFF `
149-
-DOPENSSL_ROOT_DIR="C:/Program Files/OpenSSL-Win64"
177+
-DOPENSSL_ROOT_DIR="${{ steps.openssl.outputs.root }}"
150178
151179
- name: Build
152180
run: cmake --build build --config Release

0 commit comments

Comments
 (0)