forked from microsoft/react-native-gallery
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ci.yml
108 lines (92 loc) · 2.75 KB
/
ci.yml
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
schedules:
- cron: '0 0 * * *'
displayName: Nightly Build
branches:
include:
- main
- cm-ci-test
batch: true
strategy:
matrix:
canary:
UPGRADE: true
PUBLISH_APP: false
VERSION_NAME: react-native-windows@canary
latest:
UPGRADE: true
PUBLISH_APP: false
VERSION_NAME: react-native-windows@latest
preview:
UPGRADE: true
PUBLISH_APP: false
VERSION_NAME: react-native-windows@preview
publish:
UPGRADE: false
PUBLISH_APP: true
VERSION_NAME: [email protected]
variables:
- group: rngallery_Variables
- name: BuildLogDirectory
value: $(Build.BinariesDirectory)\x64\BuildLogs
pool:
name: rnw-pool-4
demands: ImageOverride -equals rnw-img-vs2022-node18
steps:
- checkout: self
clean: false
- task: NuGetToolInstaller@0
inputs:
versionSpec: '>=5.8.0'
- task: NodeTool@0
displayName: Installing Node
inputs:
versionSpec: '18.x'
- task: CmdLine@2
displayName: Upgrade react-native-windows Version
condition: eq(variables['UPGRADE'], 'true')
inputs:
script: node scripts/use-upgrade-version.js --upgradeVersion $(VERSION_NAME)
- task: CmdLine@2
displayName: Installing Yarn
inputs:
script: npm install -g yarn
- task: NuGetCommand@2
displayName: NuGet restore
inputs:
command: restore
restoreSolution: windows/rngallery.sln
verbosityRestore: Detailed
- task: CmdLine@2
displayName: yarn
inputs:
script: yarn install --immutable
- task: CmdLine@2
displayName: Lint and Type Checks
inputs:
script: yarn tsc | yarn lint
- task: DownloadSecureFile@1
name: signingCert
displayName: 'Download CA certificate'
inputs:
secureFile: 'rngallery_Key.pfx'
- task: CopyFiles@2
displayName: 'Copy Certificate to Windows Build Directory'
inputs:
SourceFolder: '$(signingCert.secureFilePath)'
Contents: 'rngallery_Key.pfx'
TargetFolder: '.\windows\rngallery\'
- task: CmdLine@2
displayName: Build project (Release)
timeoutInMinutes: 60
inputs:
script: npx --no-install react-native run-windows --arch x64 --no-deploy --logging --buildLogDirectory $BuildLogDirectory\Release --msbuildprops PackageCertificateKeyFile=$(signingCert.secureFilePath) --release
- task: CmdLine@2
displayName: Remove the Pfx
inputs:
script: del /f .\windows\rngallery\rngallery_Key.pfx
- task: PublishBuildArtifacts@1
displayName: Upload App
condition: and(succeededOrFailed(), eq(${{ matrix.reactNativeWindowsVersion }}, "current"))
inputs:
pathtoPublish: .\windows\AppPackages\rngallery
artifactName: 'React Native Gallery - $(Agent.JobName)-$(System.JobAttempt)'