Skip to content

Commit c212544

Browse files
authored
fix(0.81, ci): make react-native-macos-init job pass (#2915)
1 parent e395913 commit c212544

3 files changed

Lines changed: 18 additions & 10 deletions

File tree

.github/workflows/microsoft-test-react-native-macos-init.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ jobs:
2626
run: yarn install
2727

2828
- name: Build community CLI plugin
29-
run: yarn build
29+
run: |
30+
yarn build
31+
# yarn build rewrites package.json exports; restore them
32+
git checkout -- packages/*/package.json
3033
3134
- name: Build react-native-macos-init
3235
working-directory: packages/react-native-macos-init
@@ -47,11 +50,21 @@ jobs:
4750
npx --yes @react-native-community/cli init testcli --version ${{ steps.rn-version.outputs.version }}
4851
working-directory: ${{ runner.temp }}
4952

53+
- name: Pack local react-native-macos
54+
working-directory: packages/react-native
55+
run: |
56+
set -eox pipefail
57+
# Use a tarball instead of a direct path to avoid symlinks
58+
yarn pack -o ${{ runner.temp }}/react-native-macos.tgz
59+
5060
- name: Install local react-native-macos
5161
working-directory: ${{ runner.temp }}/testcli
5262
run: |
5363
set -eox pipefail
54-
npm install ${{ github.workspace }}/packages/react-native
64+
npm install ${{ runner.temp }}/react-native-macos.tgz
65+
# yarn pack strips execute bits from shell scripts.
66+
# publishConfig.executableFiles could fix this but doesn't support globs.
67+
find node_modules/react-native-macos/scripts -name '*.sh' -exec chmod +x {} +
5568
5669
- name: Apply macOS template
5770
working-directory: ${{ runner.temp }}/testcli

packages/react-native/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@
111111
"rn-get-polyfills.js",
112112
"scripts/replace-rncore-version.js",
113113
"scripts/bundle.js",
114-
"scripts/cocoapods",
115-
"scripts/codegen",
114+
"scripts/cocoapods/**",
115+
"scripts/codegen/**",
116116
"scripts/compose-source-maps.js",
117117
"scripts/find-node-for-xcode.sh",
118118
"scripts/generate-codegen-artifacts.js",
@@ -135,7 +135,7 @@
135135
"scripts/xcode/ccache.conf",
136136
"scripts/xcode/with-environment.sh",
137137
"sdks/.hermesversion",
138-
"sdks/hermes-engine",
138+
"sdks/hermes-engine/**",
139139
"sdks/hermesc",
140140
"settings.gradle.kts",
141141
"src",

packages/react-native/react-native.config.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,8 @@ try {
7171
// [macOS
7272
let apple;
7373
try {
74-
const iosPath = require.resolve('@react-native-community/cli-platform-ios', {
75-
paths: [process.cwd()],
76-
});
77-
// $FlowFixMe[untyped-import]
7874
apple = findCommunityPlatformPackage(
7975
'@react-native-community/cli-platform-apple',
80-
iosPath,
8176
);
8277
} catch {
8378
if (verbose) {

0 commit comments

Comments
 (0)