-
Notifications
You must be signed in to change notification settings - Fork 5
98 lines (81 loc) · 2.8 KB
/
build_openssl3_android.yml
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
name: android-openssl3
on: [push]
jobs:
Build-Libs-OpenSSL3-Android:
name: 'Build-Libs-OpenSSL3-Android'
runs-on: ubuntu-latest
if: |
contains(github.event.head_commit.message, '[all]') ||
contains(github.event.head_commit.message, '[android]') ||
contains(github.event.head_commit.message, '[android-openssl3]') ||
contains(github.event.head_commit.message, '[openssl3]')
env:
ANDROID_MIN_SDK: 24
ANDROID_NDK_VERSION: 'r26b'
strategy:
matrix:
include:
- arch: arm64-v8a
target: android-arm64
- arch: armeabi-v7a
target: android-arm
- arch: x86_64
target: android-x86_64
- arch: x86
target: android-x86
steps:
- name: 'Setup Android NDK'
id: setup-ndk
uses: nttld/setup-ndk@v1
with:
ndk-version: ${{ env.ANDROID_NDK_VERSION }}
- name: 'Install patchelf'
run: sudo apt-get install -y patchelf
- name: 'Get openssl'
uses: actions/checkout@v4
with:
repository: openssl/openssl
ref: openssl-3.2.1
path: openssl
- name: 'Build OpenSSL3 Android'
run: |
cd openssl
PATH=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH
./Configure ${{ matrix.target }} shared no-tests -D__ANDROID_API__=${{ env.ANDROID_MIN_SDK }}
make -j$(nproc) SHLIB_VERSION_NUMBER= build_libs
mkdir -p build/${{ matrix.arch }}
cp libcrypto.so ./build/${{ matrix.arch }}/libcrypto_3.so
cp libssl.so ./build/${{ matrix.arch }}/libssl_3.so
cd ./build/${{ matrix.arch }}
patchelf --set-soname libcrypto_3.so libcrypto_3.so
patchelf --set-soname libssl_3.so libssl_3.so
patchelf --replace-needed libcrypto.so libcrypto_3.so libssl_3.so
- name: 'Archive Android OpenSSL3 libs'
uses: actions/upload-artifact@v4
with:
name: android-openssl3-${{ matrix.arch }}
path: openssl/build
github-release:
name: GitHub Release
needs: Build-Libs-OpenSSL3-Android
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Setup | Checkout
uses: actions/checkout@v4
- name: Setup | Artifacts
uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: Setup | Checksums
run: for file in $(find ./ -name '*.so' ); do openssl dgst -sha256 -r "$file" | awk '{print $1}' > "${file}.sha256"; done
- name: Zip ALL
run: for file in *; do zip -r ${file%.*}.zip $file; done
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: android-openssl3.zip
tag: ${{ github.ref }}
overwrite: true
file_glob: true