Skip to content

Commit

Permalink
Build legacy ios wrapper in CI
Browse files Browse the repository at this point in the history
Signed-off-by: Patrik Stas <patrik.stas@absa.africa>
  • Loading branch information
Patrik-Stas committed Dec 2, 2022
1 parent b1fcfa1 commit 25ab82c
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 12 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,35 @@ jobs:
name: libvcx-ios-${{ env.PUBLISH_VERSION }}-universal
path: /tmp/artifacts/libvcx-ios-${{ env.PUBLISH_VERSION }}-universal.zip

build-and-publish-ios-legacy-wrapper:
needs: workflow-setup
runs-on: macos-11
env:
LIBVCX_VERSION: ${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}
PUBLISH_VERSION: ${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}
steps:
- name: "Git checkout"
uses: actions/checkout@v2
- name: Switch to xcode version 12.4
if: ${{ needs.workflow-setup.outputs.SKIP_IOS != 'true' }}
run: |
sudo xcode-select --switch /Applications/Xcode_12.4.app/Contents/Developer
xcodebuild -version
- name: "Build Legacy iOS wrapper"
if: ${{ needs.workflow-setup.outputs.SKIP_IOS != 'true' }}
run: |
./wrappers/ios_legacy/ci/build.sh
- uses: actions/upload-artifact@v2
if: ${{ needs.workflow-setup.outputs.SKIP_IOS != 'true' }}
with:
name: libvcx-ios-legacy-${{ env.PUBLISH_VERSION }}-device
path: /tmp/artifacts/libvcx-ios-legacy-${{ env.PUBLISH_VERSION }}-device.zip
- uses: actions/upload-artifact@v2
if: ${{ needs.workflow-setup.outputs.SKIP_IOS != 'true' }}
with:
name: libvcx-ios-legacy-${{ env.PUBLISH_VERSION }}-universal
path: /tmp/artifacts/libvcx-ios-legacy-${{ env.PUBLISH_VERSION }}-universal.zip

build-and-publish-android-device:
runs-on: ubuntu-20.04
needs: [ workflow-setup, build-docker-android ]
Expand Down
24 changes: 12 additions & 12 deletions wrappers/ios_legacy/ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ SCRIPT_DIR="$( cd "$(dirname "$0")" ; pwd -P )"
OUTPUT_DIR=/tmp/artifacts

setup() {
echo "ios/ci/build.sh: running setup()"
echo "ios_legacy/ci/build.sh: running setup()"
echo "Setup rustup"
rustup default 1.64.0
rustup component add rls-preview rust-analysis rust-src
Expand Down Expand Up @@ -72,7 +72,7 @@ setup() {
# NOTE: Each built archive must be a fat file, i.e support all required architectures
# Can be checked via e.g. `lipo -info $OUTPUT_DIR/OpenSSL-for-iPhone/lib/libssl.a`
build_crypto() {
echo "ios/ci/build.sh: running build_crypto()"
echo "ios_legacy/ci/build.sh: running build_crypto()"
if [ ! -d $OUTPUT_DIR/OpenSSL-for-iPhone ]; then
git clone https://github.com/x2on/OpenSSL-for-iPhone.git $OUTPUT_DIR/OpenSSL-for-iPhone
cd $OUTPUT_DIR/OpenSSL-for-iPhone
Expand All @@ -87,7 +87,7 @@ build_crypto() {
}

build_libsodium() {
echo "ios/ci/build.sh: running build_libsodium()"
echo "ios_legacy/ci/build.sh: running build_libsodium()"
if [ ! -d $OUTPUT_DIR/libsodium-ios ]; then
git clone https://github.com/evernym/libsodium-ios.git $OUTPUT_DIR/libsodium-ios
fi
Expand All @@ -98,7 +98,7 @@ build_libsodium() {
}

build_libzmq() {
echo "ios/ci/build.sh: running build_libzmq()"
echo "ios_legacy/ci/build.sh: running build_libzmq()"
if [ ! -d $OUTPUT_DIR/libzmq-ios ]; then
git clone https://github.com/evernym/libzmq-ios.git $OUTPUT_DIR/libzmq-ios
fi
Expand All @@ -119,7 +119,7 @@ extract_architectures() {
FILE_PATH=$1
LIB_FILE_NAME=$2
LIB_NAME=$3
echo "ios/ci/build.sh: running extract_architectures() FILE_PATH=${FILE_PATH} LIB_FILE_NAME=${LIB_FILE_NAME} LIB_NAME=${LIB_NAME}"
echo "ios_legacy/ci/build.sh: running extract_architectures() FILE_PATH=${FILE_PATH} LIB_FILE_NAME=${LIB_FILE_NAME} LIB_NAME=${LIB_NAME}"

echo FILE_PATH=$FILE_PATH
echo LIB_FILE_NAME=$LIB_FILE_NAME
Expand All @@ -142,7 +142,7 @@ extract_architectures() {
}

build_libvcx() {
echo "ios/ci/build.sh: running build_libvcx()"
echo "ios_legacy/ci/build.sh: running build_libvcx()"
WORK_DIR=$(abspath "$OUTPUT_DIR")
ARCHS="arm64 x86_64"

Expand All @@ -162,7 +162,7 @@ build_libvcx() {
}

copy_libvcx_architectures() {
echo "ios/ci/build.sh: running copy_libvcx_architectures()"
echo "ios_legacy/ci/build.sh: running copy_libvcx_architectures()"
ARCHS="arm64 x86_64"
LIB_NAME="vcx"

Expand All @@ -182,7 +182,7 @@ copy_libvcx_architectures() {
}

copy_libs_to_combine() {
echo "ios/ci/build.sh: running copy_libs_to_combine()"
echo "ios_legacy/ci/build.sh: running copy_libs_to_combine()"
mkdir -p $OUTPUT_DIR/cache/arch_libs

copy_lib_tocombine sodium libsodium
Expand All @@ -202,7 +202,7 @@ copy_lib_tocombine() {
}

combine_libs() {
echo "ios/ci/build.sh: running combine_libs()"
echo "ios_legacy/ci/build.sh: running combine_libs()"
COMBINED_LIB=$1

BUILD_CACHE=$(abspath "$OUTPUT_DIR/cache")
Expand Down Expand Up @@ -239,13 +239,13 @@ combine_libs() {
}

build_vcx_framework() {
echo "ios/ci/build.sh: running build_vcx_framework() COMBINED_LIB=${COMBINED_LIB}"
echo "ios_legacy/ci/build.sh: running build_vcx_framework() COMBINED_LIB=${COMBINED_LIB}"
COMBINED_LIB=$1
ARCHS="arm64 x86_64"

cp -v $OUTPUT_DIR/${COMBINED_LIB}.a $REPO_DIR/wrappers/ios/vcx/lib/libvcx.a
cp -v $OUTPUT_DIR/${COMBINED_LIB}.a $REPO_DIR/wrappers/ios_legacy/vcx/lib/libvcx.a

pushd $REPO_DIR/wrappers/ios/vcx
pushd $REPO_DIR/wrappers/ios_legacy/vcx
rm -rf vcx.framework.previousbuild

for ARCH in ${ARCHS[*]}; do
Expand Down

0 comments on commit 25ab82c

Please sign in to comment.