Skip to content

Build OpenSSL on Windows #1

Build OpenSSL on Windows

Build OpenSSL on Windows #1

name: Build OpenSSL on Windows
on:
push:
branches:
- mai # 你可以根据需要修改触发的分支
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 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: 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@main
with:
name: openssl-windows
path: C:\OpenSSL_build # 上传编译好的OpenSSL文件作为构建产物