Skip to content

Commit aee05bb

Browse files
authored
fix(ci): make react-native-macos-init job pass (#2917)
1 parent a054786 commit aee05bb

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

.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/react-native.config.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,9 @@ try {
7171
// [macOS
7272
let apple;
7373
try {
74-
const iosPath = require.resolve('@react-native-community/cli-platform-ios', {
75-
paths: [process.cwd()],
76-
});
7774
// $FlowFixMe[untyped-import]
7875
apple = findCommunityPlatformPackage(
7976
'@react-native-community/cli-platform-apple',
80-
iosPath,
8177
);
8278
} catch {
8379
if (verbose) {

0 commit comments

Comments
 (0)