Skip to content

Commit 8997953

Browse files
committed
chore: Update build script to build and release OpenSSL for macOS with version 3
1 parent 1a99ae0 commit 8997953

File tree

2 files changed

+38
-9
lines changed

2 files changed

+38
-9
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
uses: "actions/upload-artifact@v4"
5353
with:
5454
name: "openssl-macos-${{ matrix.config }}"
55-
path: "release/*.tar.gz"
55+
path: "*.tar.gz"
5656

5757
Release:
5858
runs-on: "ubuntu-22.04"

build-macos.sh

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
#!/bin/bash
22

3+
# Exit on error and print each command
4+
set -e
5+
set -x
6+
7+
# Build OpenSSL for macOS
8+
39
OPENSSL_VERSION="3.3.1"
410
OPENSSL_VERSION_SHORT="3"
511
NUM_CORES=$(sysctl -n hw.logicalcpu)
@@ -10,19 +16,42 @@ mv openssl-$OPENSSL_VERSION openssl_arm64
1016
cp -r openssl_arm64 openssl_x86_64
1117

1218
cd openssl_arm64
13-
./Configure shared darwin64-arm64-cc
19+
./Configure shared --prefix="$(pwd)/release" \
20+
--openssldir="$(pwd)/release" \
21+
darwin64-arm64-cc
1422
make -j$NUM_CORES
23+
# install into the current directory
24+
make install_sw
1525
cd ../
1626

1727
cd openssl_x86_64
18-
./Configure shared darwin64-x86_64-cc
28+
./Configure shared --prefix="$(pwd)/release" \
29+
--openssldir="$(pwd)/release" \
30+
darwin64-x86_64-cc
1931
make -j$NUM_CORES
32+
# install into the current directory
33+
make install_sw
2034
cd ../
2135

36+
mkdir release
37+
38+
# shared libraries
39+
lipo -create openssl_arm64/release/lib/libcrypto.$OPENSSL_VERSION_SHORT.dylib \
40+
openssl_x86_64/release/lib/libcrypto.$OPENSSL_VERSION_SHORT.dylib \
41+
-output release/lib/libcrypto.$OPENSSL_VERSION_SHORT.dylib
42+
lipo -create openssl_arm64/release/lib/libssl.$OPENSSL_VERSION_SHORT.dylib \
43+
openssl_x86_64/release/lib/libssl.$OPENSSL_VERSION_SHORT.dylib \
44+
-output release/lib/libssl.$OPENSSL_VERSION_SHORT.dylib
45+
46+
# static libraries
47+
lipo -create openssl_arm64/release/lib/libcrypto.a \
48+
openssl_x86_64/release/lib/libcrypto.a \
49+
-output release/lib/libcrypto.a
50+
lipo -create openssl_arm64/release/lib/libssl.a \
51+
openssl_x86_64/release/lib/libssl.a \
52+
-output release/lib/libssl.a
53+
54+
cp -r openssl_arm64/release/include release/include
2255

23-
lipo -create openssl_arm64/libcrypto.$OPENSSL_VERSION_SHORT.dylib \
24-
openssl_x86_64/libcrypto.$OPENSSL_VERSION_SHORT.dylib \
25-
-output libcrypto.$OPENSSL_VERSION_SHORT.dylib
26-
lipo -create openssl_arm64/libssl.$OPENSSL_VERSION_SHORT.dylib \
27-
openssl_x86_64/libssl.$OPENSSL_VERSION_SHORT.dylib \
28-
-output libssl.$OPENSSL_VERSION_SHORT.dylib
56+
# create a tarball
57+
tar -czvf openssl-$OPENSSL_VERSION-macos.tar.gz release

0 commit comments

Comments
 (0)