Skip to content

Commit 69864ae

Browse files
committed
Windows openssl refresh workflow
1 parent 94374e0 commit 69864ae

File tree

2 files changed

+95
-17
lines changed

2 files changed

+95
-17
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Refresh Windows OpenSSL
2+
3+
on:
4+
workflow_dispatch:
5+
6+
permissions:
7+
contents: read
8+
9+
jobs:
10+
refresh:
11+
name: Refresh Vendored Windows OpenSSL
12+
runs-on: windows-2022
13+
defaults:
14+
run:
15+
shell: cmd
16+
17+
steps:
18+
- name: Checkout Repo
19+
uses: actions/checkout@v6
20+
with:
21+
fetch-depth: 0
22+
23+
- name: Refresh vendored OpenSSL
24+
run: deps\openssl-windows.bat
25+
26+
- name: Show generated OpenSSL version
27+
shell: powershell
28+
run: Select-String -Path deps\openssl-include\openssl\opensslv.h -Pattern 'OPENSSL_VERSION_TEXT'
29+
30+
- name: Upload vendored OpenSSL artifact
31+
uses: actions/upload-artifact@v4
32+
with:
33+
name: windows-openssl
34+
if-no-files-found: error
35+
retention-days: 7
36+
path: |
37+
deps/OpenSSL-Win32/**
38+
deps/OpenSSL-Win64/**
39+
deps/OpenSSL-Win64-ARM/**
40+
deps/openssl-include/**

deps/openssl-windows.bat

Lines changed: 55 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,57 @@
1-
call git clone https://github.com/microsoft/vcpkg vcpkg
1+
@echo off
2+
setlocal
3+
4+
pushd "%~dp0"
5+
6+
if not exist .\vcpkg (
7+
call git clone --depth 1 https://github.com/microsoft/vcpkg vcpkg
8+
if errorlevel 1 goto :fail
9+
) else (
10+
pushd .\vcpkg
11+
call git pull --ff-only
12+
if errorlevel 1 goto :fail
13+
popd
14+
)
15+
216
call .\vcpkg\bootstrap-vcpkg.bat
17+
if errorlevel 1 goto :fail
18+
19+
call .\vcpkg\vcpkg install openssl:x64-windows-static
20+
if errorlevel 1 goto :fail
21+
call .\vcpkg\vcpkg install openssl:x86-windows-static
22+
if errorlevel 1 goto :fail
23+
call .\vcpkg\vcpkg install openssl:arm64-windows-static
24+
if errorlevel 1 goto :fail
25+
26+
if exist .\OpenSSL-Win32 rmdir /s /q .\OpenSSL-Win32
27+
if exist .\OpenSSL-Win64 rmdir /s /q .\OpenSSL-Win64
28+
if exist .\OpenSSL-Win64-ARM rmdir /s /q .\OpenSSL-Win64-ARM
29+
if exist .\openssl-include rmdir /s /q .\openssl-include
30+
31+
mkdir .\OpenSSL-Win32
32+
if errorlevel 1 goto :fail
33+
mkdir .\OpenSSL-Win64
34+
if errorlevel 1 goto :fail
35+
mkdir .\OpenSSL-Win64-ARM
36+
if errorlevel 1 goto :fail
37+
mkdir .\openssl-include
38+
if errorlevel 1 goto :fail
39+
mkdir .\openssl-include\openssl
40+
if errorlevel 1 goto :fail
41+
42+
xcopy /Y /I .\vcpkg\installed\x64-windows-static\lib\*.* .\OpenSSL-Win64\ >nul
43+
if errorlevel 1 goto :fail
44+
xcopy /Y /I .\vcpkg\installed\x64-windows-static\include\openssl\*.* .\openssl-include\openssl\ >nul
45+
if errorlevel 1 goto :fail
46+
xcopy /Y /I .\vcpkg\installed\x86-windows-static\lib\*.* .\OpenSSL-Win32\ >nul
47+
if errorlevel 1 goto :fail
48+
xcopy /Y /I .\vcpkg\installed\arm64-windows-static\lib\*.* .\OpenSSL-Win64-ARM\ >nul
49+
if errorlevel 1 goto :fail
50+
51+
popd
52+
exit /b 0
353

4-
.\vcpkg\vcpkg install openssl:x64-windows-static
5-
if %errorlevel% neq 0 exit /b %errorlevel%
6-
.\vcpkg\vcpkg install openssl:x86-windows-static
7-
if %errorlevel% neq 0 exit /b %errorlevel%
8-
.\vcpkg\vcpkg install openssl:arm64-windows-static
9-
if %errorlevel% neq 0 exit /b %errorlevel%
10-
11-
if not exist .\OpenSSL-Win32 mkdir .\OpenSSL-Win32
12-
if not exist .\OpenSSL-Win64 mkdir .\OpenSSL-Win64
13-
if not exist .\OpenSSL-Win64-ARM mkdir .\OpenSSL-Win64-ARM
14-
if not exist .\openssl-include mkdir .\openssl-include
15-
16-
copy .\vcpkg\installed\x64-windows-static\lib\*.* .\OpenSSL-Win64
17-
copy .\vcpkg\installed\x64-windows-static\include\openssl\*.* .\openssl-include\openssl
18-
copy .\vcpkg\installed\x86-windows-static\lib\*.* .\OpenSSL-Win32
19-
copy .\vcpkg\installed\arm64-windows-static\lib\*.* .\OpenSSL-Win64-ARM
54+
:fail
55+
set EXIT_CODE=%errorlevel%
56+
popd
57+
exit /b %EXIT_CODE%

0 commit comments

Comments
 (0)