Skip to content

Android Workflow update #133

Android Workflow update

Android Workflow update #133

Workflow file for this run

name: iOS Build
on:
push:
paths-ignore:
- 'android/**'
- 'apidoc/**'
pull_request:
paths-ignore:
- 'android/**'
- 'apidoc/**'
workflow_dispatch:
jobs:
ios:
runs-on: macos-13
name: iOS
env:
SDK_VERSION: 12.4.0.GA
# This one uses Swift 3.8.1. If you're running into the "Unsupported Swift architecture", verify which
# Swift version is used for the specified Ti SDK version, e.g. by looking into:
# ~/Library/Application Support/Titanium/mobilesdk/osx/<version>/iphone/Frameworks/TitaniumKit.xcframework/ios-arm64/TitaniumKit.framework/Headers/TitaniumKit-Swift.h
#
# An overview of macOS <> Xcode <> Swift versions can be found here: https://developer.apple.com/support/xcode/
DEVELOPER_DIR: /Applications/Xcode_14.3.1.app/Contents/Developer
steps:
- uses: actions/checkout@v4
- name: Display Swift Version
run: swift --version
- name: Retrieve package version
run: |
PACKAGE_VERSION=$(sed -n 's/^ *"version": *"//p' package.json | tr -d '"' | tr -d ',' | tr -d '[[:space:]]')
echo "packageVersion=${PACKAGE_VERSION}" >> $GITHUB_ENV
- name: Test Native Code
working-directory: ./iphone
run: xcodebuild -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 12' -scheme hyperloop -target Tests -configuration Debug GCC_PREPROCESSOR_DEFINITIONS='USE_JSCORE_FRAMEWORK=1' test | xcpretty -r junit
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '18.x'
- name: Package metabase
working-directory: ./packages/hyperloop-ios-metabase
run: |
npm pack
METABASE_VERSION=$(sed -n 's/^ *"version": *"//p' package.json | tr -d '"' | tr -d ',' | tr -d '[[:space:]]')
echo "METABASE_VERSION=${METABASE_VERSION}" >> $GITHUB_ENV
- name: Prepare hook
working-directory: ./iphone/hooks
run: |
sed -i.bak 's/0.0.0-PLACEHOLDER/${{ env.packageVersion }}/g' ./package.json
rm -rf package.json.bak
npm ci --production
npm i ../../packages/hyperloop-ios-metabase/hyperloop-metabase-${{ env.METABASE_VERSION }}.tgz
rm -rf node_modules/findit/test
rm -rf package-lock.json
- run: npm i -g titanium
name: Install Titanium CLI
- name: Cache SDK
id: titanium-cache
uses: actions/cache@v4
with:
path: ~/Library/Application Support/Titanium/mobilesdk/osx/${{ env.SDK_VERSION }}
key: ${{ runner.os }}-titanium-sdk-${{ env.SDK_VERSION }}
restore-keys: |
${{ runner.os }}-titanium-sdk-
- run: ti sdk install ${{ env.SDK_VERSION }} --force
name: Install SDK
if: steps.titanium-cache.outputs.cache-hit != 'true'
- name: Build
working-directory: ./iphone
run: |
sed -i.bak 's/VERSION/${{ env.packageVersion }}/g' ./manifest
sed -i .bak 's/TITANIUM_SDK_VERSION = .*/TITANIUM_SDK_VERSION = ${{ env.SDK_VERSION }}/' titanium.xcconfig
ti build -p ios --build-only
- name: Archive iOS artifact
uses: actions/upload-artifact@v4
with:
name: hyperloop-iphone-${{ env.packageVersion }}
if-no-files-found: error
path: |
iphone/dist/hyperloop-iphone-*.zip