Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: macos support #63

Merged
merged 3 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/popular-oranges-provide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"react-native-bottom-tabs": patch
"react-native-bottom-tabs-example": patch
---

feat: macos support
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 }}"
13 changes: 13 additions & 0 deletions apps/example/macos/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
ws_dir = Pathname.new(__dir__)
ws_dir = ws_dir.parent until
File.exist?("#{ws_dir}/node_modules/react-native-test-app/macos/test_app.rb") ||
ws_dir.expand_path.to_s == '/'
require "#{ws_dir}/node_modules/react-native-test-app/macos/test_app.rb"

workspace 'ReactNativeBottomTabs.xcworkspace'

use_test_app! do |test_app|
# Workaround for not using use_frameworks! in the Podfile
pod 'SDWebImage', :modular_headers => true
pod 'SDWebImageSVGCoder', :modular_headers => true
okwasniewski marked this conversation as resolved.
Show resolved Hide resolved
end
Loading
Loading