-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (94 loc) · 3.13 KB
/
test.yml
File metadata and controls
107 lines (94 loc) · 3.13 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: Build OpenSSL on Windows
on:
workflow_call:
inputs:
major:
type: string
required: true
minor:
type: string
required: true
patch:
type: string
required: true
REPO_BRANCH:
type: string
required: true
PRE:
type: boolean
default: false
required: false
env:
REPO_URL: https://github.com/openssl/openssl.git
major: 3
minor: 5
patch: 0
instctx: openssl
instbuild64: C:\OpenSSL_build
instlicense: ../openssl/LICENSE.txt
jobs:
Build:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@main # 检出代码
- name: Install dependencies
run: |
choco install strawberryperl
choco install nasm
choco install make
# 安装其他可能需要的依赖,如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 $env:REPO_URL -b ${{ inputs.REPO_BRANCH }}
- name: Configure OpenSSL
run: |
cd openssl # 假设你的OpenSSL源代码在仓库的openssl目录下
perl Configure VC-WIN64A no-asm --prefix=$env:instbuild64 # 根据你的需求配置OpenSSL
- name: Build OpenSSL
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
cd openssl
nmake /S
nmake /S install
- name: Build Installer
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
cd windows-installer
nmake /S INSTMAJOR=${{ inputs.major }} INSTMINOR=${{ inputs.minor }} INSTPATCH=${{ inputs.patch }} INSTCTX=${{ env.instctx }} INSTBUILD64=${{ env.instbuild64 }} INSTLICENSE=${{ env.instlicense }}
- name: Archive artifacts
uses: actions/upload-artifact@main
with:
name: openssl-windows
path: ${{ env.instbuild64 }} # 上传编译好的OpenSSL文件作为构建产物
- name: Upload installer as artifact
uses: actions/upload-artifact@main
with:
name: openssl-installer
path: windows-installer/openssl*.exe
- name: Generate release tag
id: tag
run: |
Set-TimeZone -ID "China Standard Time"
cd C:\
7z a openssl-for-windows.zip .\OpenSSL_build\
echo "tag-name=v${{ inputs.major }}.${{ inputs.minor }}.${{ inputs.patch }}" >> $env:GITHUB_OUTPUT
echo "status=success" >> $env:GITHUB_OUTPUT
- name: Upload firmware to release
if: steps.tag.outputs.status == 'success'
uses: softprops/action-gh-release@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.tag.outputs.tag-name }}
name: openssl-v${{ inputs.major }}.${{ inputs.minor }}.${{ inputs.patch }}
prerelease: ${{ inputs.PRE }}
files: |
C:\openssl-for-windows.zip
windows-installer/openssl*.exe