Skip to content

Commit d43f39d

Browse files
authored
feat: macos support (#63)
* feat: macos support * Create popular-oranges-provide.md * feat: macos ci
1 parent 4e0fa46 commit d43f39d

24 files changed

+2258
-109
lines changed

.changeset/popular-oranges-provide.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"react-native-bottom-tabs": patch
3+
"react-native-bottom-tabs-example": patch
4+
---
5+
6+
feat: macos support

.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 }}"

apps/example/macos/Podfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
ws_dir = Pathname.new(__dir__)
2+
ws_dir = ws_dir.parent until
3+
File.exist?("#{ws_dir}/node_modules/react-native-test-app/macos/test_app.rb") ||
4+
ws_dir.expand_path.to_s == '/'
5+
require "#{ws_dir}/node_modules/react-native-test-app/macos/test_app.rb"
6+
7+
workspace 'ReactNativeBottomTabs.xcworkspace'
8+
9+
use_test_app! do |test_app|
10+
# Workaround for not using use_frameworks! in the Podfile
11+
pod 'SDWebImage', :modular_headers => true
12+
pod 'SDWebImageSVGCoder', :modular_headers => true
13+
end

0 commit comments

Comments
 (0)