-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: macOS new architecture build (#2341)
# Summary Based on recommendations from this [proposition](#2192 (comment)) and added some changes now we can build macOS using the new architecture. ## Compatibility | OS | Implemented | | ------- | :---------: | | macOS | ✅ | --------- Co-authored-by: Maciej Stosio <[email protected]>
- Loading branch information
1 parent
0d97399
commit 67620f5
Showing
21 changed files
with
459 additions
and
260 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Test new architecture macOS build | ||
on: | ||
pull_request: | ||
paths: | ||
- '.github/workflows/macos-fabric-test.yml' | ||
- 'RNSVG.podspec' | ||
- 'apple/**' | ||
- 'macos-example/package.json' | ||
- 'macos-example/macos/**' | ||
- 'src/fabric/**' | ||
- 'package.json' | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
reusable-macos-build: | ||
if: github.repository == 'software-mansion/react-native-svg' | ||
uses: ./.github/workflows/reusable-macos-build.yml | ||
with: | ||
new_arch_enabled: '1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,21 @@ | ||
name: Test macOS build | ||
name: Test paper macOS build | ||
on: | ||
pull_request: | ||
paths: | ||
- .github/workflows/macos-build-test.yml | ||
- RNSVG.podspec | ||
- apple/** | ||
- macos-example/package.json | ||
- macos-example/macos/** | ||
- src/fabric/** | ||
- package.json | ||
- '.github/workflows/macos-build-test.yml' | ||
- 'RNSVG.podspec' | ||
- 'apple/**' | ||
- 'macos-example/package.json' | ||
- 'macos-example/macos/**' | ||
- 'src/fabric/**' | ||
- 'package.json' | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
reusable-macos-build: | ||
if: github.repository == 'software-mansion/react-native-svg' | ||
runs-on: macos-14 | ||
strategy: | ||
matrix: | ||
working-directory: [macos-example] | ||
fail-fast: false | ||
concurrency: | ||
group: macos-${{ matrix.working-directory }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
steps: | ||
- name: Check out Git repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Restore react-native-svg node_modules from cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-node-modules-svg-${{ hashFiles('yarn.lock') }} | ||
restore-keys: ${{ runner.os }}-node-modules-svg- | ||
|
||
- name: Install react-native-svg node_modules | ||
run: yarn install | ||
|
||
- name: Restore app node_modules from cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ matrix.working-directory }}/node_modules | ||
key: ${{ runner.os }}-node-modules-${{ matrix.working-directory }}-${{ hashFiles(format('{0}/yarn.lock', matrix.working-directory)) }} | ||
restore-keys: ${{ runner.os }}-node-modules-${{ matrix.working-directory }}- | ||
|
||
- name: Install app node_modules | ||
working-directory: ${{ matrix.working-directory }} | ||
run: yarn install | ||
|
||
- name: Restore Pods from cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
${{ matrix.working-directory }}/macos/Pods | ||
~/Library/Caches/CocoaPods | ||
~/.cocoapods | ||
key: ${{ runner.os }}-pods-${{ matrix.working-directory }}-${{ hashFiles(format('{0}/macos/Podfile.lock', matrix.working-directory)) }} | ||
|
||
- name: Install Pods | ||
working-directory: ${{ matrix.working-directory }}/macos | ||
run: pod install | ||
|
||
- name: Restore build artifacts from cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/Library/Developer/Xcode/DerivedData | ||
key: ${{ runner.os }}-macos-derived-data-${{ matrix.working-directory }}-${{ hashFiles(format('{0}/macos/Podfile.lock', matrix.working-directory)) }} | ||
|
||
- name: Build app | ||
working-directory: ${{ matrix.working-directory }} | ||
run: yarn macos | ||
uses: ./.github/workflows/reusable-macos-build.yml | ||
with: | ||
new_arch_enabled: '0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: Reusable macOS Build | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
new_arch_enabled: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
build: | ||
runs-on: macos-14 | ||
strategy: | ||
matrix: | ||
working-directory: [macos-example] | ||
fail-fast: false | ||
concurrency: | ||
group: macos-${{ matrix.working-directory }}-${{ github.ref }}-${{ inputs.new_arch_enabled }} | ||
cancel-in-progress: true | ||
steps: | ||
- name: Check out Git repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Restore react-native-svg node_modules from cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-node-modules-svg-${{ hashFiles('yarn.lock') }} | ||
restore-keys: ${{ runner.os }}-node-modules-svg- | ||
|
||
- name: Install react-native-svg node modules | ||
run: yarn install | ||
|
||
- name: Restore app node_modules from cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ matrix.working-directory }}/node_modules | ||
key: ${{ runner.os }}-node-modules-${{ matrix.working-directory }}-${{ hashFiles(format('{0}/yarn.lock', matrix.working-directory)) }} | ||
restore-keys: ${{ runner.os }}-node-modules-${{ matrix.working-directory }}- | ||
|
||
- name: Install app node modules | ||
working-directory: ${{ matrix.working-directory }} | ||
run: yarn install | ||
|
||
- name: Restore Pods from cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
${{ matrix.working-directory }}/macos/Pods | ||
~/Library/Caches/CocoaPods | ||
~/.cocoapods | ||
key: ${{ runner.os }}-pods-${{ matrix.working-directory }}-${{ hashFiles(format('{0}/macos/Podfile.lock', matrix.working-directory)) }} | ||
|
||
- name: Install Pods | ||
working-directory: ${{ matrix.working-directory }}/macos | ||
run: RCT_NEW_ARCH_ENABLED=${{ inputs.new_arch_enabled }} pod install | ||
|
||
- name: Restore build artifacts from cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/Library/Developer/Xcode/DerivedData | ||
key: ${{ runner.os }}-macos-derived-data-${{ matrix.working-directory }}-${{ hashFiles(format('{0}/macos/Podfile.lock', matrix.working-directory)) }} | ||
|
||
- name: Build app | ||
working-directory: ${{ matrix.working-directory }} | ||
run: yarn macos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.