forked from microsoft/react-native-macos
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmicrosoft-test-react-native-macos-init.yml
More file actions
80 lines (68 loc) · 2.56 KB
/
microsoft-test-react-native-macos-init.yml
File metadata and controls
80 lines (68 loc) · 2.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Test react-native-macos init
on:
workflow_call:
jobs:
test-react-native-macos-init:
name: "Test react-native-macos init"
runs-on: macos-26
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
with:
filter: blob:none
fetch-depth: 0
lfs: false
clean: true
- name: Setup toolchain
uses: ./.github/actions/microsoft-setup-toolchain
with:
node-version: '22'
platform: 'macos'
- name: Install npm dependencies
run: yarn install
- name: Build community CLI plugin
run: |
yarn build
# yarn build rewrites package.json exports; restore them
git checkout -- packages/*/package.json
- name: Build react-native-macos-init
working-directory: packages/react-native-macos-init
run: yarn build
- name: Determine React Native version
id: rn-version
run: |
RN_VERSION=$(node -e "
const pkg = require('./packages/react-native/package.json');
console.log(pkg.peerDependencies['react-native']);
")
echo "version=$RN_VERSION" >> "$GITHUB_OUTPUT"
- name: Initialize new project
run: |
set -eox pipefail
npx --yes @react-native-community/cli init testcli --version ${{ steps.rn-version.outputs.version }}
working-directory: ${{ runner.temp }}
- name: Pack local react-native-macos
working-directory: packages/react-native
run: |
set -eox pipefail
# Use a tarball instead of a direct path to avoid symlinks
yarn pack -o ${{ runner.temp }}/react-native-macos.tgz
- name: Install local react-native-macos
working-directory: ${{ runner.temp }}/testcli
run: |
set -eox pipefail
npm install ${{ runner.temp }}/react-native-macos.tgz
# yarn pack strips execute bits from shell scripts.
# publishConfig.executableFiles could fix this but doesn't support globs.
find node_modules/react-native-macos/scripts -name '*.sh' -exec chmod +x {} +
- name: Apply macOS template
working-directory: ${{ runner.temp }}/testcli
run: |
set -eox pipefail
node ${{ github.workspace }}/packages/react-native-macos-init/bin.js --verbose --overwrite --prerelease
pod install --project-directory=macos
- name: Build macOS app
working-directory: ${{ runner.temp }}/testcli
run: |
set -eox pipefail
npx react-native build-macos