-
Notifications
You must be signed in to change notification settings - Fork 26
85 lines (72 loc) · 2.61 KB
/
template-testcli.yml
File metadata and controls
85 lines (72 loc) · 2.61 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
81
82
83
84
85
name: Test CLI
on:
workflow_call:
inputs:
vmImage:
required: false
default: 'windows-latest'
type: string
rnwVersion:
required: false
default: 'latest'
type: string
useRnwWindowsInit:
required: false
default: false
type: boolean
jobs:
testcli:
name: New RNW@${{ inputs.rnwVersion }} App
runs-on: ${{ inputs.vmImage }}
steps:
- uses: actions/checkout@v4
- name: yarn install
run: yarn install
- name: build TS
run: yarn build
- name: yarn link
run: yarn link
working-directory: package
- name: determine RN versions
run: |
$rnwVersion = & npm show react-native-windows@${{ inputs.rnwVersion }} version
echo "RNW_VERSION=$rnwVersion" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
$rnVersion = & npm show react-native-windows@$rnwVersion peerDependencies.react-native
echo "RN_VERSION=$rnVersion" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
Write-Host "Using react-native-windows@$rnwVersion with react-native@$rnVersion"
- name: create react-native app
run: |
Write-Host "Using react-native@$Env:RN_VERSION"
npx @react-native-community/cli init testrnx --version $Env:RN_VERSION --skip-install --install-pods false --verbose --skip-git-init true
working-directory: ../
- name: yarn install
run: yarn install
working-directory: ../testrnx
- name: react-native-windows-init
if: ${{ inputs.useRnwWindowsInit }}
run: |
Write-Host "Using react-native-windows@$Env:RNW_VERSION"
npx --yes react-native-windows-init --overwrite --verbose --version $Env:RNW_VERSION
yarn install
working-directory: ../testrnx
- name: react-native init-windows
if: ${{ !inputs.useRnwWindowsInit }}
run: |
Write-Host "Using react-native-windows@$Env:RNW_VERSION"
yarn add react-native-windows@$Env:RNW_VERSION
yarn install
npx @react-native-community/cli@latest init-windows --overwrite --logging
yarn install
working-directory: ../testrnx
- name: add react-native-xaml
run: |
yarn add react-native-xaml
yarn link react-native-xaml
yarn install
working-directory: ../testrnx
- name: autolink
run: npx @react-native-community/cli autolink-windows --logging
working-directory: ../testrnx
- name: build app
run: npx @react-native-community/cli run-windows --no-launch --no-deploy --no-packager --logging
working-directory: ../testrnx