Skip to content

Commit f396bd3

Browse files
committed
Use vcpkg for OpenSSL in Windows workflows
Replace Chocolatey-installed OpenSSL with vcpkg in CI and prebuild workflows. The changes run `vcpkg install openssl:x64-windows` and set OPENSSL_ROOT to the vcpkg installed path via VCPKG_INSTALLATION_ROOT, removing the previous hardcoded Program Files path and manual lib copying. This centralizes Windows OpenSSL dependency management and simplifies locating libs for node-gyp during builds.
1 parent faf8283 commit f396bd3

2 files changed

Lines changed: 4 additions & 18 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,11 @@ jobs:
3636

3737
- name: Install OpenSSL (Windows)
3838
if: runner.os == 'Windows'
39-
run: choco install openssl -y
40-
shell: cmd
39+
run: vcpkg install openssl:x64-windows
4140

4241
- name: Set OpenSSL env (Windows)
4342
if: runner.os == 'Windows'
44-
run: |
45-
$root = "C:\Program Files\OpenSSL-Win64"
46-
echo "OPENSSL_ROOT=$root" >> $env:GITHUB_ENV
47-
# Copy libs to root/lib so node-gyp can find them
48-
Get-ChildItem -Path "$root\lib" -Recurse -Filter "libcrypto*" | ForEach-Object {
49-
Copy-Item $_.FullName -Destination "$root\lib\" -Force -ErrorAction SilentlyContinue
50-
}
43+
run: echo "OPENSSL_ROOT=$env:VCPKG_INSTALLATION_ROOT\installed\x64-windows" >> $env:GITHUB_ENV
5144
shell: pwsh
5245

5346
- name: Install dependencies

.github/workflows/prebuild.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,11 @@ jobs:
4444

4545
- name: Install OpenSSL (Windows)
4646
if: runner.os == 'Windows'
47-
run: choco install openssl -y
48-
shell: cmd
47+
run: vcpkg install openssl:x64-windows
4948

5049
- name: Set OpenSSL env (Windows)
5150
if: runner.os == 'Windows'
52-
run: |
53-
$root = "C:\Program Files\OpenSSL-Win64"
54-
echo "OPENSSL_ROOT=$root" >> $env:GITHUB_ENV
55-
# Copy libs to root/lib so node-gyp can find them
56-
Get-ChildItem -Path "$root\lib" -Recurse -Filter "libcrypto*" | ForEach-Object {
57-
Copy-Item $_.FullName -Destination "$root\lib\" -Force -ErrorAction SilentlyContinue
58-
}
51+
run: echo "OPENSSL_ROOT=$env:VCPKG_INSTALLATION_ROOT\installed\x64-windows" >> $env:GITHUB_ENV
5952
shell: pwsh
6053

6154
- name: Install dependencies

0 commit comments

Comments
 (0)