Skip to content

Update main.yml

Update main.yml #25

Workflow file for this run

name: Build OpenSSL on Windows
on:
push:
branches:
- main # 你可以根据需要修改触发的分支
workflow_dispatch:
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 path
shell: cmd
run: |
%comspec% /k ""C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat""
set path="C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.41.34120\bin\Hostx64\x64" # 将vstudio/nmake添加进环境变量中
set path="C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64" # 将vstudio/nmake添加进环境变量中
set path=%path%;"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\Hostx64\x64" # 将vstudio/nmake添加进环境变量中
set path="C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\Hostx86\x86" # 将vstudio/nmake添加进环境变量中
set path="C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC"
- 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: |
cd openssl
%comspec% /k ""C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat""
nmake
nmake install
- name: Archive artifacts
uses: actions/upload-artifact@v3
with:
name: openssl-windows
path: C:\OpenSSL_build # 上传编译好的OpenSSL文件作为构建产物