Skip to content

Commit 04bed40

Browse files
authored
chore: fix static framework workflow (#7251)
## Summary ## Test plan
1 parent 332932b commit 04bed40

File tree

5 files changed

+39
-25
lines changed

5 files changed

+39
-25
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,41 @@
1-
name: Static framework Reanimated build check [Nightly]
1+
name: Use frameworks Reanimated build check [Nightly]
22
env:
33
YARN_ENABLE_IMMUTABLE_INSTALLS: 0
4+
YARN_ENABLE_HARDENED_MODE: 0
45
on:
56
pull_request:
67
paths:
7-
- .github/workflows/static-framework-reanimated-build-nightly.yml
8+
- .github/workflows/use-frameworks-reanimated-build-check-nightly.yml
89
schedule:
910
- cron: '37 19 * * *'
1011
workflow_call:
1112
workflow_dispatch:
1213

1314
jobs:
14-
build:
15+
use-frameworks-reanimated-build-check-nightly:
1516
if: github.repository == 'software-mansion/react-native-reanimated'
1617
runs-on: macos-14
17-
strategy:
18-
matrix:
19-
react-native-architecture: ['Paper', 'Fabric']
20-
fail-fast: false
2118
concurrency:
22-
group: ios-static-framework-${{ matrix.react-native-architecture }}-${{ github.ref }}
19+
group: use-${{matrix.type}}-frameworks-reanimated-build-check-nightly-${{ github.ref }}
2320
cancel-in-progress: true
2421
env:
2522
APP_NAME: app
23+
strategy:
24+
matrix:
25+
type: [static, dynamic]
2626
steps:
27+
- name: Setup Node
28+
uses: actions/setup-node@v4
29+
with:
30+
registry-url: https://registry.npmjs.org/
2731
- name: Setup Yarn
2832
# Sometimes `npx @react-native-community/cli init` fails at random.
2933
# Pre-installing it with Yarn seems to improve stability.
3034
run: corepack enable && yarn init
3135
- name: Install React Native
3236
run: yarn add @react-native-community/cli
3337
- name: Create app
34-
run: yarn rnc-cli init ${{ env.APP_NAME }} --skip-install --pm yarn --install-pods false --skip-git-init
38+
run: yarn rnc-cli init ${{ env.APP_NAME }} --skip-install --install-pods false --skip-git-init
3539
- name: Setup Yarn Modern in app
3640
working-directory: ${{ env.APP_NAME }}
3741
run: |
@@ -44,14 +48,12 @@ jobs:
4448
- name: Install Reanimated
4549
working-directory: ${{ env.APP_NAME }}
4650
run: yarn add "react-native-reanimated@https://github.com/software-mansion/react-native-reanimated.git#workspace=react-native-reanimated&commit=${{ github.sha }}"
47-
- name: Install Paper Pods
48-
if: ${{ matrix.react-native-architecture == 'Paper' }}
49-
working-directory: ${{env.APP_NAME}}/ios
50-
run: export USE_FRAMEWORKS=static NO_FLIPPER=1 && bundle install && bundle exec pod install
51-
- name: Install Fabric Pods
52-
if: ${{ matrix.react-native-architecture == 'Fabric' }}
51+
- name: Install Worklets
52+
working-directory: ${{ env.APP_NAME }}
53+
run: yarn add "react-native-worklets@https://github.com/software-mansion/react-native-reanimated.git#workspace=react-native-worklets&commit=${{ github.sha }}"
54+
- name: Install ${{matrix.type}} Pods
5355
working-directory: ${{env.APP_NAME}}/ios
54-
run: export USE_FRAMEWORKS=static NO_FLIPPER=1 RCT_NEW_ARCH_ENABLED=1 && bundle install && bundle exec pod update
56+
run: export USE_FRAMEWORKS=${{matrix.type}} && bundle install && bundle exec pod update
5557
- name: Build app
5658
working-directory: ${{env.APP_NAME}}/ios
57-
run: xcodebuild -workspace ${{env.APP_NAME}}.xcworkspace -scheme ${{env.APP_NAME}} -configuration Debug -destination 'generic/platform=iOS Simulator' build | xcpretty
59+
run: xcodebuild -workspace ${{env.APP_NAME}}.xcworkspace -scheme ${{env.APP_NAME}} -configuration Debug -destination 'generic/platform=iOS Simulator' build

packages/react-native-reanimated/RNReanimated.podspec

+4-2
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,10 @@ Pod::Spec.new do |s|
8585
'"$(PODS_ROOT)/Headers/Public/hermes-engine"',
8686
'"$(PODS_ROOT)/Headers/Public/RNWorklets"',
8787
"\"$(PODS_ROOT)/#{$config[:react_native_common_dir]}\"",
88-
"\"$(PODS_ROOT)/#{$config[:react_native_reanimated_dir_from_pods_root]}/apple\"",
89-
"\"$(PODS_ROOT)/#{$config[:react_native_reanimated_dir_from_pods_root]}/Common/cpp\"",
88+
"\"$(PODS_ROOT)/#{$config[:dynamic_frameworks_reanimated_dir]}/apple\"",
89+
"\"$(PODS_ROOT)/#{$config[:dynamic_frameworks_reanimated_dir]}/Common/cpp\"",
90+
"\"$(PODS_ROOT)/#{$config[:dynamic_frameworks_worklets_dir]}/apple\"",
91+
"\"$(PODS_ROOT)/#{$config[:dynamic_frameworks_worklets_dir]}/Common/cpp\"",
9092
].join(' '),
9193
"OTHER_CFLAGS" => "$(inherited) #{folly_flags} #{fabric_flags} #{example_flag} #{version_flags} #{debug_flag} #{compilation_metadata_generation_flag}"
9294
}

packages/react-native-reanimated/scripts/reanimated_utils.rb

+8-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ def find_config()
1414
:is_tvos_target => nil,
1515
:react_native_node_modules_dir => nil,
1616
:react_native_common_dir => nil,
17-
:react_native_reanimated_dir_from_pods_root => nil,
17+
:dynamic_frameworks_reanimated_dir => nil,
18+
:dynamic_frameworks_worklets_dir => nil,
1819
}
1920

2021
react_native_node_modules_dir = File.join(File.dirname(`cd "#{Pod::Config.instance.installation_root.to_s}" && node --print "require.resolve('react-native/package.json')"`), '..')
@@ -46,7 +47,12 @@ def find_config()
4647

4748
react_native_reanimated_dir_absolute = File.join(__dir__, '..')
4849
react_native_reanimated_dir_relative = Pathname.new(react_native_reanimated_dir_absolute).relative_path_from(pods_root).to_s
49-
result[:react_native_reanimated_dir_from_pods_root] = react_native_reanimated_dir_relative
50+
result[:dynamic_frameworks_reanimated_dir] = react_native_reanimated_dir_relative
51+
52+
react_native_worklets_node_modules_dir = File.join(File.dirname(`cd "#{Pod::Config.instance.installation_root.to_s}" && node --print "require.resolve('react-native-worklets/package.json')"`), '..')
53+
react_native_worklets_dir_absolute = File.join(react_native_worklets_node_modules_dir, 'react-native-worklets')
54+
react_native_worklets_dir_relative = Pathname.new(react_native_worklets_dir_absolute).relative_path_from(pods_root).to_s
55+
result[:dynamic_frameworks_worklets_dir] = react_native_worklets_dir_relative
5056

5157
return result
5258
end

packages/react-native-worklets/RNWorklets.podspec

+2-3
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ Pod::Spec.new do |s|
1717
s.platforms = { :ios => ios_min_version, :tvos => "9.0", :osx => "10.14", :visionos => "1.0" }
1818
s.source = { :git => "https://github.com/software-mansion/react-native-reanimated.git", :tag => "#{s.version}" }
1919

20-
s.source_files = "apple/*.{h,m,mm,cpp}"
21-
2220
s.subspec "worklets" do |ss|
2321
ss.source_files = "Common/cpp/worklets/**/*.{cpp,h}"
2422
ss.header_dir = "worklets"
@@ -50,7 +48,6 @@ Pod::Spec.new do |s|
5048
'"$(PODS_ROOT)/DoubleConversion"',
5149
'"$(PODS_ROOT)/Headers/Private/React-Core"',
5250
'"$(PODS_ROOT)/Headers/Private/Yoga"',
53-
"\"$(PODS_ROOT)/#{$worklets_config[:react_native_common_dir]}\"",
5451
].join(' '),
5552
"FRAMEWORK_SEARCH_PATHS" => '"${PODS_CONFIGURATION_BUILD_DIR}/React-hermes"',
5653
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
@@ -64,6 +61,8 @@ Pod::Spec.new do |s|
6461
'"$(PODS_ROOT)/Headers/Public/React-hermes"',
6562
'"$(PODS_ROOT)/Headers/Public/hermes-engine"',
6663
"\"$(PODS_ROOT)/#{$worklets_config[:react_native_common_dir]}\"",
64+
"\"$(PODS_ROOT)/#{$worklets_config[:dynamic_frameworks_worklets_dir]}/apple\"",
65+
"\"$(PODS_ROOT)/#{$worklets_config[:dynamic_frameworks_worklets_dir]}/Common/cpp\"",
6766
].join(' '),
6867
}
6968

packages/react-native-worklets/scripts/worklets_utils.rb

+6-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ def worklets_find_config()
1212
:react_native_version => nil,
1313
:react_native_minor_version => nil,
1414
:react_native_node_modules_dir => nil,
15-
:react_native_common_dir => nil
15+
:react_native_common_dir => nil,
16+
:dynamic_frameworks_worklets_dir => nil,
1617
}
1718

1819
react_native_node_modules_dir = File.join(File.dirname(`cd "#{Pod::Config.instance.installation_root.to_s}" && node --print "require.resolve('react-native/package.json')"`), '..')
@@ -41,6 +42,10 @@ def worklets_find_config()
4142
react_native_common_dir_relative = Pathname.new(react_native_common_dir_absolute).relative_path_from(pods_root).to_s
4243
result[:react_native_common_dir] = react_native_common_dir_relative
4344

45+
react_native_worklets_dir_absolute = File.join(__dir__, '..')
46+
react_native_worklets_dir_relative = Pathname.new(react_native_worklets_dir_absolute).relative_path_from(pods_root).to_s
47+
result[:dynamic_frameworks_worklets_dir] = react_native_worklets_dir_relative
48+
4449
return result
4550
end
4651

0 commit comments

Comments
 (0)