diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c07fdc7..5192392 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,27 +70,30 @@ jobs: ${{ runner.os }}-turborepo-android- - name: Check turborepo cache for Android + id: check-turbo-cache run: | TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:android').cache.status") if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then - echo "turbo_cache_hit=1" >> $GITHUB_ENV + echo "hit=true" >> $GITHUB_OUTPUT + else + echo "hit=false" >> $GITHUB_OUTPUT fi - name: Install JDK - if: env.turbo_cache_hit != 1 + if: steps.check-turbo-cache.outputs.hit != 'true' uses: actions/setup-java@v3 with: distribution: "zulu" java-version: "17" - name: Finalize Android SDK - if: env.turbo_cache_hit != 1 + if: steps.check-turbo-cache.outputs.hit != 'true' run: | /bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null" - name: Cache Gradle - if: env.turbo_cache_hit != 1 + if: steps.check-turbo-cache.outputs.hit != 'true' uses: actions/cache@v3 with: path: | @@ -128,15 +131,18 @@ jobs: ${{ runner.os }}-turborepo-ios- - name: Check turborepo cache for iOS + id: check-turbo-cache run: | TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:ios').cache.status") if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then - echo "turbo_cache_hit=1" >> $GITHUB_ENV + echo "hit=true" >> $GITHUB_OUTPUT + else + echo "hit=false" >> $GITHUB_OUTPUT fi - name: Cache cocoapods - if: env.turbo_cache_hit != 1 + if: steps.check-turbo-cache.outputs.hit != 'true' id: cocoapods-cache uses: actions/cache@v3 with: @@ -147,14 +153,21 @@ jobs: ${{ runner.os }}-cocoapods- - name: Install cocoapods - if: env.turbo_cache_hit != 1 && steps.cocoapods-cache.outputs.cache-hit != - 'true' + if: steps.check-turbo-cache.outputs.hit != 'true' && + steps.cocoapods-cache.outputs.cache-hit != 'true' run: | cd example/ios - pod install + pod install --repo-update env: NO_FLIPPER: 1 + - name: Generate Podfile.lock for caching + if: steps.check-turbo-cache.outputs.hit != 'true' && + steps.cocoapods-cache.outputs.cache-hit != 'true' + run: | + cd example/ios + pod install + - name: Build example for iOS run: | yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}" diff --git a/example/ios/Podfile b/example/ios/Podfile index fed9f3a..cec5ed3 100644 --- a/example/ios/Podfile +++ b/example/ios/Podfile @@ -9,3 +9,6 @@ require "#{ws_dir}/node_modules/react-native-test-app/test_app.rb" workspace 'ZebraLinkosExample.xcworkspace' use_test_app! + +# Explicitly include the native module +pod 'react-native-zebra-linkos', :path => '../..' diff --git a/example/package.json b/example/package.json index 855de16..48bc0a4 100644 --- a/example/package.json +++ b/example/package.json @@ -5,7 +5,7 @@ "scripts": { "android": "react-native run-android", "build:android": "npm run mkdist && react-native bundle --entry-file index.js --platform android --dev true --bundle-output dist/main.android.jsbundle --assets-dest dist && react-native build-android --extra-params \"--no-daemon --console=plain -PreactNativeArchitectures=arm64-v8a\"", - "build:ios": "npm run mkdist && react-native bundle --entry-file index.js --platform ios --dev true --bundle-output dist/main.ios.jsbundle --assets-dest dist && react-native build-ios --scheme RnScheduleClearCacheExample --mode Debug --extra-params \"-sdk iphonesimulator CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ GCC_OPTIMIZATION_LEVEL=0 GCC_PRECOMPILE_PREFIX_HEADER=YES ASSETCATALOG_COMPILER_OPTIMIZATION=time DEBUG_INFORMATION_FORMAT=dwarf COMPILER_INDEX_STORE_ENABLE=NO\"", + "build:ios": "npm run mkdist && react-native bundle --entry-file index.js --platform ios --dev true --bundle-output dist/main.ios.jsbundle --assets-dest dist && cd ios && xcodebuild -workspace ZebraLinkosExample.xcworkspace -configuration Debug -scheme ZebraLinkosExample -destination 'generic/platform=iOS Simulator' -sdk iphonesimulator COMPILER_INDEX_STORE_ENABLE=NO", "ios": "react-native run-ios", "mkdist": "node -e \"require('node:fs').mkdirSync('dist', { recursive: true, mode: 0o755 })\"", "start": "react-native start"