Skip to content

Commit 28f3524

Browse files
committed
openssl-1.1.1
1 parent 1b6a62e commit 28f3524

1 file changed

Lines changed: 206 additions & 0 deletions

File tree

Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,206 @@
1+
name: Build OpenSSL with mingw64 and msvc2019
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- '.github/workflows/build-openssl-1.1.1.yml'
8+
- 'openssl-options.txt'
9+
- 'mingw-gcc.txt'
10+
- 'cl_version'
11+
12+
env:
13+
OpenSSL_VERSION: "1.1.1zg"
14+
15+
jobs:
16+
build_with_msvc-2019:
17+
runs-on: windows-2022
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- uses: shogo82148/actions-setup-perl@v1
22+
with:
23+
distribution: strawberry
24+
25+
- name: Install or Download Dependencies
26+
run: |
27+
perl --version
28+
curl -L https://github.com/kzalewski/openssl-1.1.1/archive/refs/tags/${{ env.OpenSSL_VERSION }}.tar.gz -o openssl-${{ env.OpenSSL_VERSION }}.tar.gz
29+
dir
30+
31+
- name: Setup msvc2019 x64 Environment
32+
uses: ilammy/msvc-dev-cmd@v1
33+
with:
34+
toolset: 14.29
35+
36+
- name: msvc2019 x64 Build OpenSSL-${{ env.OpenSSL_VERSION }}
37+
shell: cmd
38+
run: |
39+
echo ${{ github.workspace }}
40+
echo ~~~~~~~~~~~~ msvc2019 build begin ~~~~~~~~~~~~
41+
cl.exe
42+
tar -xf openssl-${{ env.OpenSSL_VERSION }}.tar.gz
43+
cd openssl-1.1.1-${{ env.OpenSSL_VERSION }}
44+
perl.exe Configure no-asm shared VC-WIN64A --prefix=${{ github.workspace }}/openssl-${{ env.OpenSSL_VERSION }}-msvc2019-x64 --openssldir=${{ github.workspace }}/openssl-${{ env.OpenSSL_VERSION }}-msvc2019-x64/ssl && nmake && nmake install
45+
cd ..
46+
cd ${{ github.workspace }}/openssl-${{ env.OpenSSL_VERSION }}-msvc2019-x64 && 7z -mx5 a ../openssl-${{ env.OpenSSL_VERSION }}-msvc2019-x64.7z *
47+
cd ..
48+
echo ~~~~~~~~~~~~ msvc2019 build end ~~~~~~~~~~~~
49+
rm -rf openssl-openssl-${{ env.OpenSSL_VERSION }}
50+
rm -rf ${{ github.workspace }}/openssl-${{ env.OpenSSL_VERSION }}-msvc2019-x64
51+
52+
- name: Setup msvc2019 x86 Environment
53+
uses: ilammy/msvc-dev-cmd@v1
54+
with:
55+
arch: amd64_x86
56+
toolset: 14.29
57+
58+
- name: msvc2019 x86 Build OpenSSL-${{ env.OpenSSL_VERSION }}
59+
shell: cmd
60+
run: |
61+
echo ${{ github.workspace }}
62+
echo ~~~~~~~~~~~~ msvc2019 build begin ~~~~~~~~~~~~
63+
cl.exe
64+
tar -xf openssl-${{ env.OpenSSL_VERSION }}.tar.gz
65+
cd openssl-1.1.1-${{ env.OpenSSL_VERSION }}
66+
perl.exe Configure no-asm shared VC-WIN32 --prefix=${{ github.workspace }}/openssl-${{ env.OpenSSL_VERSION }}-msvc2019-x86 --openssldir=${{ github.workspace }}/openssl-${{ env.OpenSSL_VERSION }}-msvc2019-x86/ssl && make && nmake install
67+
cd ..
68+
cd ${{ github.workspace }}/openssl-${{ env.OpenSSL_VERSION }}-msvc2019-x86 && 7z -mx5 a ../openssl-${{ env.OpenSSL_VERSION }}-msvc2019-x86.7z *
69+
cd ..
70+
echo ~~~~~~~~~~~~ msvc2019 build end ~~~~~~~~~~~~
71+
rm -rf openssl-openssl-${{ env.OpenSSL_VERSION }}
72+
rm -rf ${{ github.workspace }}/openssl-${{ env.OpenSSL_VERSION }}-msvc2019-x86
73+
74+
- uses: andreaswilli/delete-release-assets-action@v4.0.0
75+
with:
76+
github_token: ${{ secrets.GITHUB_TOKEN }}
77+
tag: openssl-${{ env.OpenSSL_VERSION }}
78+
deleteOnlyFromDrafts: false
79+
80+
- name: Upload OpenSSL-${{ env.OpenSSL_VERSION }}
81+
uses: softprops/action-gh-release@v2
82+
with:
83+
tag_name: openssl-${{ env.OpenSSL_VERSION }}
84+
name: Latest build of OpenSSL-${{ env.OpenSSL_VERSION }}
85+
draft: false
86+
prerelease: true
87+
files: |
88+
./openssl-${{ env.OpenSSL_VERSION }}-*.7z
89+
90+
build_with_mingw-gcc14:
91+
needs: build_with_msvc-2019
92+
runs-on: windows-2022
93+
defaults:
94+
run:
95+
shell: msys2 {0}
96+
steps:
97+
- name: Install msys2
98+
uses: msys2/setup-msys2@v2
99+
with:
100+
update: true
101+
install: >-
102+
cmake
103+
make
104+
unzip
105+
gzip
106+
p7zip
107+
m4
108+
nasm
109+
patch
110+
tar
111+
texinfo
112+
perl
113+
curl
114+
git
115+
116+
- uses: actions/checkout@v4
117+
118+
- name: Install or Download Dependencies
119+
run: |
120+
perl --version
121+
mkdir deps
122+
cd deps && mkdir mingw64 && cd ..
123+
curl -L https://github.com/kzalewski/openssl-1.1.1/archive/refs/tags/${{ env.OpenSSL_VERSION }}.tar.gz -o openssl-${{ env.OpenSSL_VERSION }}.tar.gz
124+
curl -L https://github.com/nonwill/mingw-distro/releases/download/mingw64-gcc15-crt_latest/mingw-w64+gcc-i686-all.7z -o mingw-w64_gcc-i686-all.7z
125+
curl -L https://github.com/nonwill/mingw-distro/releases/download/mingw64-gcc15-crt_latest/mingw-w64+gcc-x86_64-all.7z -o mingw-w64_gcc-x86_64-all.7z
126+
dir
127+
128+
- name: MinGW Build OpenSSL-${{ env.OpenSSL_VERSION }}
129+
run: |
130+
export WSP_ROOT=$PWD
131+
export USER_MINGW_DIR=$WSP_ROOT/deps/mingw64
132+
echo ~~~~~~~~~~~~ mingw32 build prepare ~~~~~~~~~~~~
133+
7z x mingw-w64_gcc-i686-all.7z -r -o$USER_MINGW_DIR
134+
rm -f mingw-w64_gcc-i686-all.7z
135+
export PATH=$USER_MINGW_DIR/bin:$PATH
136+
gcc -v
137+
echo ~~~~~~~~~~~~ mingw32 build begin ~~~~~~~~~~~~
138+
tar -xf openssl-${{ env.OpenSSL_VERSION }}.tar.gz
139+
cd openssl-1.1.1-${{ env.OpenSSL_VERSION }}
140+
perl.exe Configure no-idea no-mdc2 no-rc5 shared mingw \
141+
--prefix=$WSP_ROOT/openssl-${{ env.OpenSSL_VERSION }}-mingw64 \
142+
--openssldir=$WSP_ROOT/openssl-${{ env.OpenSSL_VERSION }}-mingw64/ssl && \
143+
make && make install
144+
cd ..
145+
strip $WSP_ROOT/openssl-${{ env.OpenSSL_VERSION }}-mingw64/bin/*.dll
146+
strip $WSP_ROOT/openssl-${{ env.OpenSSL_VERSION }}-mingw64/bin/*.exe
147+
cd $WSP_ROOT/openssl-${{ env.OpenSSL_VERSION }}-mingw64
148+
7z -mx5 a ../openssl-${{ env.OpenSSL_VERSION }}-mingw64-i686.7z *
149+
cd ..
150+
echo ~~~~~~~~~~~~ mingw32 build end ~~~~~~~~~~~~
151+
rm -rf openssl-openssl-${{ env.OpenSSL_VERSION }}
152+
rm -rf $WSP_ROOT/openssl-${{ env.OpenSSL_VERSION }}-mingw64
153+
rm -rf $USER_MINGW_DIR/*
154+
echo ~~~~~~~~~~~~ mingw64 build prepare ~~~~~~~~~~~~
155+
7z x mingw-w64_gcc-x86_64-all.7z -r -o$USER_MINGW_DIR
156+
rm -f mingw-w64_gcc-x86_64-all.7z
157+
gcc -v
158+
echo ~~~~~~~~~~~~ mingw64 build begin ~~~~~~~~~~~~
159+
tar -xf openssl-${{ env.OpenSSL_VERSION }}.tar.gz
160+
cd openssl-1.1.1-${{ env.OpenSSL_VERSION }}
161+
perl.exe Configure no-idea no-mdc2 no-rc5 shared mingw64 \
162+
--prefix=$WSP_ROOT/openssl-${{ env.OpenSSL_VERSION }}-mingw64 \
163+
--openssldir=$WSP_ROOT/openssl-${{ env.OpenSSL_VERSION }}-mingw64/ssl && \
164+
make && make install
165+
cd ..
166+
strip $WSP_ROOT/openssl-${{ env.OpenSSL_VERSION }}-mingw64/bin/*.dll
167+
strip $WSP_ROOT/openssl-${{ env.OpenSSL_VERSION }}-mingw64/bin/*.exe
168+
cd $WSP_ROOT/openssl-${{ env.OpenSSL_VERSION }}-mingw64
169+
7z -mx5 a ../openssl-${{ env.OpenSSL_VERSION }}-mingw64-x86_64.7z *
170+
cd ..
171+
echo ~~~~~~~~~~~~ mingw64 build end ~~~~~~~~~~~~
172+
rm -rf openssl-openssl-${{ env.OpenSSL_VERSION }}
173+
rm -rf $WSP_ROOT/openssl-${{ env.OpenSSL_VERSION }}-mingw64
174+
175+
- name: Setup msvc2019 x64 Environment
176+
uses: ilammy/msvc-dev-cmd@v1
177+
with:
178+
toolset: 14.29
179+
180+
- name: Get date and Cl version
181+
id: vars
182+
shell: bash
183+
run: |
184+
export WSP_ROOT=$PWD
185+
export USER_MINGW_DIR=$WSP_ROOT/deps/mingw64
186+
export PATH=$USER_MINGW_DIR/bin:$PATH
187+
echo "update_date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
188+
echo "vc_install_dir=$VCToolsInstallDir" >> $GITHUB_OUTPUT
189+
echo "cl_exe_info=$(cl > cl_version 2>&1 && head -n 1 cl_version)" >> $GITHUB_OUTPUT
190+
echo "gcc_exe_info=$(gcc --version > gcc_version 2>&1 && head -n 1 gcc_version)" >> $GITHUB_OUTPUT
191+
rm -rf $USER_MINGW_DIR
192+
193+
- name: Upload OpenSSL-${{ env.OpenSSL_VERSION }}
194+
uses: softprops/action-gh-release@v2
195+
with:
196+
tag_name: openssl-${{ env.OpenSSL_VERSION }}
197+
name: Latest build of OpenSSL-${{ env.OpenSSL_VERSION }}
198+
body: |
199+
date: ${{ steps.vars.outputs.update_date }}
200+
cl: ${{ steps.vars.outputs.cl_exe_info }}
201+
gcc: ${{ steps.vars.outputs.gcc_exe_info }}
202+
draft: false
203+
prerelease: false
204+
make_latest: true
205+
files: |
206+
./openssl-${{ env.OpenSSL_VERSION }}-*.7z

0 commit comments

Comments
 (0)