Skip to content

Commit

Permalink
feat: macos ci
Browse files Browse the repository at this point in the history
  • Loading branch information
okwasniewski committed Dec 4, 2024
1 parent 0ddcf00 commit 08456d0
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 4 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
#import <React/RCTUIManager.h>
#import <React/RCTImageLoader.h>
#import <React/RCTBridge.h>
#if TARGET_OS_OSX
#import <React/RCTUIKit.h>
#endif

#if TARGET_OS_OSX
#import <AppKit/AppKit.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
15 changes: 15 additions & 0 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down

0 comments on commit 08456d0

Please sign in to comment.