-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[android-openssl3]
- Loading branch information
Showing
1 changed file
with
98 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 |