Skip to content

Commit 264bd59

Browse files
committed
openssl-1.1.1
1 parent 1b6a62e commit 264bd59

1 file changed

Lines changed: 210 additions & 0 deletions

File tree

Lines changed: 210 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,210 @@
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-openssl-${{ env.OpenSSL_VERSION }}
44+
perl.exe Configure no-asm no-idea no-mdc2 no-rc5 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_sw
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-openssl-${{ env.OpenSSL_VERSION }}
66+
perl.exe Configure no-asm no-idea no-mdc2 no-rc5 shared VC-WIN32 --prefix=${{ github.workspace }}/openssl-${{ env.OpenSSL_VERSION }}-msvc2019-x86 --openssldir=${{ github.workspace }}/openssl-${{ env.OpenSSL_VERSION }}-msvc2019-x86/ssl && nmake && nmake install_sw
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-openssl-${{ env.OpenSSL_VERSION }}
140+
perl.exe Configure \
141+
`cat ../openssl-options.txt` \
142+
mingw \
143+
--prefix=$WSP_ROOT/openssl-${{ env.OpenSSL_VERSION }}-mingw64 \
144+
--openssldir=$WSP_ROOT/openssl-${{ env.OpenSSL_VERSION }}-mingw64/ssl && \
145+
make -j4 && make install_sw
146+
cd ..
147+
strip $WSP_ROOT/openssl-${{ env.OpenSSL_VERSION }}-mingw64/bin/*.dll
148+
strip $WSP_ROOT/openssl-${{ env.OpenSSL_VERSION }}-mingw64/bin/*.exe
149+
cd $WSP_ROOT/openssl-${{ env.OpenSSL_VERSION }}-mingw64
150+
7z -mx5 a ../openssl-${{ env.OpenSSL_VERSION }}-mingw64-i686.7z *
151+
cd ..
152+
echo ~~~~~~~~~~~~ mingw32 build end ~~~~~~~~~~~~
153+
rm -rf openssl-openssl-${{ env.OpenSSL_VERSION }}
154+
rm -rf $WSP_ROOT/openssl-${{ env.OpenSSL_VERSION }}-mingw64
155+
rm -rf $USER_MINGW_DIR/*
156+
echo ~~~~~~~~~~~~ mingw64 build prepare ~~~~~~~~~~~~
157+
7z x mingw-w64_gcc-x86_64-all.7z -r -o$USER_MINGW_DIR
158+
rm -f mingw-w64_gcc-x86_64-all.7z
159+
gcc -v
160+
echo ~~~~~~~~~~~~ mingw64 build begin ~~~~~~~~~~~~
161+
tar -xf openssl-${{ env.OpenSSL_VERSION }}.tar.gz
162+
cd openssl-openssl-${{ env.OpenSSL_VERSION }}
163+
perl.exe Configure \
164+
`cat ../openssl-options.txt` \
165+
mingw64 \
166+
--prefix=$WSP_ROOT/openssl-${{ env.OpenSSL_VERSION }}-mingw64 \
167+
--openssldir=$WSP_ROOT/openssl-${{ env.OpenSSL_VERSION }}-mingw64/ssl && \
168+
make -j4 && make install_sw
169+
cd ..
170+
strip $WSP_ROOT/openssl-${{ env.OpenSSL_VERSION }}-mingw64/bin/*.dll
171+
strip $WSP_ROOT/openssl-${{ env.OpenSSL_VERSION }}-mingw64/bin/*.exe
172+
cd $WSP_ROOT/openssl-${{ env.OpenSSL_VERSION }}-mingw64
173+
7z -mx5 a ../openssl-${{ env.OpenSSL_VERSION }}-mingw64-x86_64.7z *
174+
cd ..
175+
echo ~~~~~~~~~~~~ mingw64 build end ~~~~~~~~~~~~
176+
rm -rf openssl-openssl-${{ env.OpenSSL_VERSION }}
177+
rm -rf $WSP_ROOT/openssl-${{ env.OpenSSL_VERSION }}-mingw64
178+
179+
- name: Setup msvc2019 x64 Environment
180+
uses: ilammy/msvc-dev-cmd@v1
181+
with:
182+
toolset: 14.29
183+
184+
- name: Get date and Cl version
185+
id: vars
186+
shell: bash
187+
run: |
188+
export WSP_ROOT=$PWD
189+
export USER_MINGW_DIR=$WSP_ROOT/deps/mingw64
190+
export PATH=$USER_MINGW_DIR/bin:$PATH
191+
echo "update_date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
192+
echo "vc_install_dir=$VCToolsInstallDir" >> $GITHUB_OUTPUT
193+
echo "cl_exe_info=$(cl > cl_version 2>&1 && head -n 1 cl_version)" >> $GITHUB_OUTPUT
194+
echo "gcc_exe_info=$(gcc --version > gcc_version 2>&1 && head -n 1 gcc_version)" >> $GITHUB_OUTPUT
195+
rm -rf $USER_MINGW_DIR
196+
197+
- name: Upload OpenSSL-${{ env.OpenSSL_VERSION }}
198+
uses: softprops/action-gh-release@v2
199+
with:
200+
tag_name: openssl-${{ env.OpenSSL_VERSION }}
201+
name: Latest build of OpenSSL-${{ env.OpenSSL_VERSION }}
202+
body: |
203+
date: ${{ steps.vars.outputs.update_date }}
204+
cl: ${{ steps.vars.outputs.cl_exe_info }}
205+
gcc: ${{ steps.vars.outputs.gcc_exe_info }}
206+
draft: false
207+
prerelease: false
208+
make_latest: true
209+
files: |
210+
./openssl-${{ env.OpenSSL_VERSION }}-*.7z

0 commit comments

Comments
 (0)