Skip to content

Commit 08456d0

Browse files
committed
feat: macos ci
1 parent 0ddcf00 commit 08456d0

File tree

5 files changed

+67
-4
lines changed

5 files changed

+67
-4
lines changed

.github/workflows/ci.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,3 +242,49 @@ jobs:
242242
- name: Build example for iOS
243243
run: |
244244
yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}"
245+
246+
build-macos:
247+
runs-on: macos-15
248+
env:
249+
TURBO_CACHE_DIR: .turbo/macos
250+
steps:
251+
- name: Checkout
252+
uses: actions/checkout@v3
253+
254+
- name: Setup
255+
uses: ./.github/actions/setup
256+
257+
- name: Build package
258+
run: yarn build
259+
260+
- name: Install xcbeautify
261+
run: |
262+
brew install xcbeautify
263+
264+
- name: Cache turborepo for macOS
265+
uses: actions/cache@v3
266+
with:
267+
path: ${{ env.TURBO_CACHE_DIR }}
268+
key: ${{ runner.os }}-turborepo-macos-${{ hashFiles('yarn.lock') }}
269+
restore-keys: |
270+
${{ runner.os }}-turborepo-macos-
271+
272+
- name: Check turborepo cache for macOS
273+
run: |
274+
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")
275+
276+
if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
277+
echo "turbo_cache_hit=1" >> $GITHUB_ENV
278+
fi
279+
280+
- name: Install cocoapods
281+
if: env.turbo_cache_hit != 1 && steps.cocoapods-cache.outputs.cache-hit != 'true'
282+
run: |
283+
cd apps/example
284+
pod install --project-directory=macos
285+
env:
286+
NO_FLIPPER: 1
287+
288+
- name: Build example for macOS
289+
run: |
290+
yarn turbo run build:macos --cache-dir="${{ env.TURBO_CACHE_DIR }}"

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"build:android": "turbo run build:android",
1717
"build:android:fabric": "turbo run build:android:fabric",
1818
"build:ios": "turbo run build:ios",
19+
"build:macos": "turbo run build:macos",
1920
"build:ios-expo": "turbo run build:ios-expo",
2021
"build:android-expo": "turbo run build:android-expo",
2122
"publish-packages": "turbo run build lint && changeset version && changeset publish"

packages/react-native-bottom-tabs/ios/RCTTabViewViewManager.mm

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
#import <React/RCTUIManager.h>
33
#import <React/RCTImageLoader.h>
44
#import <React/RCTBridge.h>
5-
#if TARGET_OS_OSX
6-
#import <React/RCTUIKit.h>
7-
#endif
85

96
#if TARGET_OS_OSX
107
#import <AppKit/AppKit.h>

packages/react-native-bottom-tabs/react-native-bottom-tabs.podspec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ Pod::Spec.new do |s|
1212
s.license = package["license"]
1313
s.authors = package["author"]
1414

15-
s.platforms = { :ios => "14.0", :visionos => "1.0", :tvos => "15.1", :macos => "11.0" }
15+
s.ios.deployment_target = "14.0"
16+
s.visionos.deployment_target = "1.0"
17+
s.tvos.deployment_target = "15.1"
18+
s.osx.deployment_target = "11.0"
19+
1620
s.source = { :git => "https://github.com/okwasniewski/react-native-bottom-tabs.git", :tag => "#{s.version}" }
1721

1822
s.source_files = "ios/**/*.{h,m,mm,cpp,swift}"

turbo.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,21 @@
7373
],
7474
"outputs": []
7575
},
76+
"build:macos": {
77+
"env": ["RCT_NEW_ARCH_ENABLED"],
78+
"inputs": [
79+
"packages/*/package.json",
80+
"packages/*/*.podspec",
81+
"packages/*/ios",
82+
"packages/*/src/*.ts",
83+
"packages/*/src/*.tsx",
84+
"apps/example/package.json",
85+
"apps/example/macos",
86+
"!apps/example/macos/build",
87+
"!apps/example/macos/Pods"
88+
],
89+
"outputs": []
90+
},
7691
"build:ios-expo": {
7792
"env": ["RCT_NEW_ARCH_ENABLED"],
7893
"inputs": [

0 commit comments

Comments
 (0)