-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (56 loc) · 2.45 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Build OpenSSL on Windows
on:
push:
branches:
- main # 你可以根据需要修改触发的分支
workflow_dispatch:
env:
add_vs_to_path: false
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@main # 检出代码
- name: Install dependencies
run: |
choco install perl
choco install nasm
choco install make
choco install visualstudio2022buildtools --package-parameters "`"--add Microsoft.VisualStudio.Workload.NativeDesktop;includeRecommended`"" --yes
choco install visualstudio2022community --yes
choco install visualstudio2022-workload-nativedesktop --yes
# 安装其他可能需要的依赖,如VC++ Build Tools等,如果需要可以添加
- name: add NASM to path
shell: cmd
run: |
set path="C:\Program Files\NASM" # 将NASM添加进环境变量中
- name: add vstudio/nmake to 环境变量
if: env.add_vs_to_path == true
shell: cmd
run: |
set path=%path%;"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64" # 将vstudio/nmake添加进环境变量中
set path=%path%;"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\Hostx64\x86"
set path=%path%;"C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE"
set path=%path%;"C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools"
set lib=%lib%;"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\lib\x64"
set lib=%lib%;"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include"
- name: Clone source code
run: |
git clone https://github.com/openssl/openssl.git
- name: Configure OpenSSL
run: |
cd openssl # 假设你的OpenSSL源代码在仓库的openssl目录下
perl Configure VC-WIN64A no-asm --prefix=C:\OpenSSL_build # 根据你的需求配置OpenSSL
- name: Build OpenSSL
shell: cmd
run: |
call ""C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat""
cd openssl
nmake
nmake install
- name: Archive artifacts
uses: actions/upload-artifact@v3
with:
name: openssl-windows
path: C:\OpenSSL_build # 上传编译好的OpenSSL文件作为构建产物