diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0141b8d..9d1b189 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -242,3 +242,49 @@ jobs: - name: Build example for iOS run: | yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}" + + build-macos: + runs-on: macos-15 + env: + TURBO_CACHE_DIR: .turbo/macos + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup + uses: ./.github/actions/setup + + - name: Build package + run: yarn build + + - name: Install xcbeautify + run: | + brew install xcbeautify + + - name: Cache turborepo for macOS + uses: actions/cache@v3 + with: + path: ${{ env.TURBO_CACHE_DIR }} + key: ${{ runner.os }}-turborepo-macos-${{ hashFiles('yarn.lock') }} + restore-keys: | + ${{ runner.os }}-turborepo-macos- + + - name: Check turborepo cache for macOS + run: | + TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:macos --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:macos').cache.status") + + if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then + echo "turbo_cache_hit=1" >> $GITHUB_ENV + fi + + - name: Install cocoapods + if: env.turbo_cache_hit != 1 && steps.cocoapods-cache.outputs.cache-hit != 'true' + run: | + cd apps/example + pod install --project-directory=macos + env: + NO_FLIPPER: 1 + + - name: Build example for macOS + run: | + yarn turbo run build:macos --cache-dir="${{ env.TURBO_CACHE_DIR }}" diff --git a/package.json b/package.json index 69df5c3..b0ccdfc 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "build:android": "turbo run build:android", "build:android:fabric": "turbo run build:android:fabric", "build:ios": "turbo run build:ios", + "build:macos": "turbo run build:macos", "build:ios-expo": "turbo run build:ios-expo", "build:android-expo": "turbo run build:android-expo", "publish-packages": "turbo run build lint && changeset version && changeset publish" diff --git a/packages/react-native-bottom-tabs/ios/RCTTabViewViewManager.mm b/packages/react-native-bottom-tabs/ios/RCTTabViewViewManager.mm index d4bde13..2c1194b 100644 --- a/packages/react-native-bottom-tabs/ios/RCTTabViewViewManager.mm +++ b/packages/react-native-bottom-tabs/ios/RCTTabViewViewManager.mm @@ -2,9 +2,6 @@ #import #import #import -#if TARGET_OS_OSX -#import -#endif #if TARGET_OS_OSX #import diff --git a/packages/react-native-bottom-tabs/react-native-bottom-tabs.podspec b/packages/react-native-bottom-tabs/react-native-bottom-tabs.podspec index 54a307c..cafd8e5 100644 --- a/packages/react-native-bottom-tabs/react-native-bottom-tabs.podspec +++ b/packages/react-native-bottom-tabs/react-native-bottom-tabs.podspec @@ -12,7 +12,11 @@ Pod::Spec.new do |s| s.license = package["license"] s.authors = package["author"] - s.platforms = { :ios => "14.0", :visionos => "1.0", :tvos => "15.1", :macos => "11.0" } + s.ios.deployment_target = "14.0" + s.visionos.deployment_target = "1.0" + s.tvos.deployment_target = "15.1" + s.osx.deployment_target = "11.0" + s.source = { :git => "https://github.com/okwasniewski/react-native-bottom-tabs.git", :tag => "#{s.version}" } s.source_files = "ios/**/*.{h,m,mm,cpp,swift}" diff --git a/turbo.json b/turbo.json index 9275846..23cc65c 100644 --- a/turbo.json +++ b/turbo.json @@ -73,6 +73,21 @@ ], "outputs": [] }, + "build:macos": { + "env": ["RCT_NEW_ARCH_ENABLED"], + "inputs": [ + "packages/*/package.json", + "packages/*/*.podspec", + "packages/*/ios", + "packages/*/src/*.ts", + "packages/*/src/*.tsx", + "apps/example/package.json", + "apps/example/macos", + "!apps/example/macos/build", + "!apps/example/macos/Pods" + ], + "outputs": [] + }, "build:ios-expo": { "env": ["RCT_NEW_ARCH_ENABLED"], "inputs": [