Skip to content

Commit e67577a

Browse files
committed
Update build to include artifacts dir
1 parent 65c3891 commit e67577a

File tree

4 files changed

+51
-14
lines changed

4 files changed

+51
-14
lines changed

.github/workflows/release.yml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
steps:
4747
- name: Checkout Source
4848
id: checkout
49-
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 #pin v4.1.6
49+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #pin v4.1.7
5050
- name: Compile Framework
5151
id: compile
5252
run: |
@@ -55,27 +55,38 @@ jobs:
5555
echo 'trusted-key 0x216094DFD0CB81EF' >> ~/.gnupg/gpg.conf
5656
echo "Starting build"
5757
GPG_VERIFY=1 ./build-ios.sh ${{ needs.query.outputs.openssl_version }}
58-
zip -r openssl.xcframework.zip openssl.xcframework/
5958
- name: Capture Build Errors
60-
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 #pin v4.3.3
59+
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 #pin v4.4.0
6160
if: failure()
6261
with:
6362
name: build_output
6463
path: build/*.log
6564
- name: Prepare Release
6665
id: prepare
6766
run: |
68-
SHASUM=$(shasum -a 256 openssl.xcframework.zip | cut -d ' ' -f1)
69-
echo "framework_checksum=${SHASUM}" >> $GITHUB_OUTPUT
70-
echo "::notice ::openssl.xcframework.zip checksum: ${SHASUM}"
67+
zip -r openssl.xcframework.zip openssl.xcframework/
68+
tar -cf openssl.tar build/openssl_*/artifacts/
69+
xz openssl.tar
70+
FRAMEWORK_SHASUM=$(shasum -a 256 openssl.xcframework.zip | cut -d ' ' -f1)
71+
echo "framework_checksum=${FRAMEWORK_SHASUM}" >> $GITHUB_OUTPUT
72+
echo "::notice ::openssl.xcframework.zip checksum: ${FRAMEWORK_SHASUM}"
73+
BUILD_SHASUM=$(shasum -a 256 openssl.tar.xz | cut -d ' ' -f1)
74+
echo "build_checksum=${BUILD_SHASUM}" >> $GITHUB_OUTPUT
75+
echo "::notice ::openssl.tar.xz checksum: ${BUILD_SHASUM}"
7176
echo "-----BEGIN EC PRIVATE KEY-----" >> private_key.pem
7277
echo '${{ secrets.SIGNING_KEY }}' >> private_key.pem
7378
echo "-----END EC PRIVATE KEY-----" >> private_key.pem
7479
openssl dgst -sign private_key.pem -sha256 -out openssl.xcframework.zip.sig openssl.xcframework.zip
80+
openssl dgst -sign private_key.pem -sha256 -out openssl.tar.xz.sig openssl.tar.xz
7581
rm -f private_key.pem
7682
- name: Make Release
7783
id: release
7884
run: |
79-
gh release create -n 'openssl.xcframework.zip SHA-256 `${{ steps.prepare.outputs.framework_checksum }}`' -t "${{ needs.query.outputs.openssl_version }}" ${{ needs.query.outputs.openssl_version }} openssl.xcframework.zip openssl.xcframework.zip.sig
85+
echo '**Checksums:**' > release.md
86+
echo '|File Name|SHA-256 Checksum|' >> release.md
87+
echo '|-|-|' >> release.md
88+
echo '|`openssl.xcframework.zip`|`${{ steps.prepare.outputs.framework_checksum }}`|' >> release.md
89+
echo '|`openssl.tar.xz`|`${{ steps.prepare.outputs.build_checksum }}`|' >> release.md
90+
gh release create --notes-file release.md -t "${{ needs.query.outputs.openssl_version }}" ${{ needs.query.outputs.openssl_version }} openssl.xcframework.zip openssl.xcframework.zip.sig openssl.tar.xz openssl.tar.xz.sig
8091
env:
8192
GH_TOKEN: ${{ github.token }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@ build/
33
*.xcframework/
44
*.tar.gz
55
*.tar.gz.asc
6+
*.tar.xz
7+
*.tar.xz.asc
68
*.zip
79
*.zip.sig

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ Use the included build script to compile a specific version or customize the con
2727
./build-ios.sh <openssl version> [optional configure parameters]
2828
```
2929
30+
To enable signature verification of downloaded artifacts set the `GPG_VERIFY` environment variable to `1`.
31+
32+
If you are building for use with a Swift package, you need to set the `WITH_MODULE_MAP` environment variable to `1`.
33+
3034
The following config parameters are always provided: `-no-shared`, `-no-ui-console`, `-no-tests`, `-no-stdio`, `-no-threads`, `-no-legacy`, `-no-ssl2`, `-no-ssl3`, `-no-asm`, `-no-weak-ssl-ciphers`.
3135
3236
## Export Compliance

build-ios.sh

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ ARCHIVE=openssl-${VERSION}.tar.gz
1818
if [ ! -f ${ARCHIVE} ]; then
1919
echo "Downloading openssl ${VERSION}..."
2020
curl -L "https://github.com/openssl/openssl/releases/download/openssl-${VERSION}/openssl-${VERSION}.tar.gz" > "${ARCHIVE}"
21-
fi
2221

23-
if [ ! -z "${GPG_VERIFY}" ]; then
24-
echo "Verifying signature for openssl-${VERSION}.tar.gz..."
25-
rm -f "${ARCHIVE}.asc"
26-
curl -L "https://github.com/openssl/openssl/releases/download/openssl-${VERSION}/openssl-${VERSION}.tar.gz.asc" > "${ARCHIVE}.asc"
27-
gpg --verify "${ARCHIVE}.asc" "${ARCHIVE}"
28-
echo "Verified signature for openssl-${VERSION}.tar.gz successfully!"
22+
if [ ! -z "${GPG_VERIFY}" ]; then
23+
echo "Verifying signature for openssl-${VERSION}.tar.gz..."
24+
rm -f "${ARCHIVE}.asc"
25+
curl -L "https://github.com/openssl/openssl/releases/download/openssl-${VERSION}/openssl-${VERSION}.tar.gz.asc" > "${ARCHIVE}.asc"
26+
gpg --verify "${ARCHIVE}.asc" "${ARCHIVE}"
27+
echo "Verified signature for ${ARCHIVE} successfully!"
28+
fi
2929
fi
3030

3131
###########
@@ -68,6 +68,9 @@ function build() {
6868
make -j $(sysctl -n hw.logicalcpu_max) >> "${LOG}" 2>&1
6969
make install >> "${LOG}" 2>&1
7070

71+
# Deprecated file (openssl should just remove it)
72+
rm artifacts/include/openssl/asn1_mac.h
73+
7174
cd ../
7275
}
7376

@@ -118,6 +121,23 @@ cp -r ${BUILDDIR}/openssl_arm64-iphoneos/artifacts/include/openssl/*.h ${BUILDDI
118121
libtool -no_warning_for_no_symbols -static -o ${BUILDDIR}/iphonesimulator/openssl.framework/openssl ${BUILDDIR}/libssl.a ${BUILDDIR}/libcrypto.a
119122
cp -r ${BUILDDIR}/openssl_arm64-iphonesimulator/artifacts/include/openssl/*.h ${BUILDDIR}/iphonesimulator/openssl.framework/Headers
120123

124+
# Inject a module map so Swift can consume this
125+
function make_modulemap {
126+
PLATFORM=${1}
127+
mkdir -p ${BUILDDIR}/${PLATFORM}/openssl.framework/Modules
128+
echo "framework module OpenSSL {" > ${BUILDDIR}/${PLATFORM}/openssl.framework/Modules/module.modulemap
129+
for HEADER in $(ls ${BUILDDIR}/${PLATFORM}/openssl.framework/Headers); do
130+
echo " header \"${HEADER}\"" >> ${BUILDDIR}/${PLATFORM}/openssl.framework/Modules/module.modulemap
131+
done
132+
echo " export *" >> ${BUILDDIR}/${PLATFORM}/openssl.framework/Modules/module.modulemap
133+
echo "}" >> ${BUILDDIR}/${PLATFORM}/openssl.framework/Modules/module.modulemap
134+
}
135+
136+
if [ ! -z "${WITH_MODULE_MAP}" ]; then
137+
make_modulemap iphoneos
138+
make_modulemap iphonesimulator
139+
fi
140+
121141
rm -rf openssl.xcframework
122142
xcodebuild -create-xcframework \
123143
-framework ${BUILDDIR}/iphoneos/openssl.framework \

0 commit comments

Comments
 (0)