forked from microsoft/react-native-windows
-
Notifications
You must be signed in to change notification settings - Fork 1
186 lines (150 loc) · 7.48 KB
/
publish.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
name: Publish
on:
push:
branches:
- none
jobs:
RnwNpmPublish:
name: React-Native-Windows Npm Build Rev Publish
runs-on: windows-2016
steps:
- name: No publish loop
if: contains( github.event.head_commit.message, '***NO_CI***')
run: exit 78
- name: Checkout
uses: actions/checkout@v1
- run: git config --global user.email "[email protected]"
- run: git config --global user.name "React-Native-Windows Bot"
- name: git remote set-url origin https://[email protected]/microsoft/react-native-windows.git
run: git remote set-url origin https://rnbot:${{ secrets.GIT_TOKEN }}@github.com/microsoft/react-native-windows.git
- name: yarn install
run: yarn install --frozen-lockfile
- run: yarn build
- name: Beachball Publish (for master)
if: github.ref == 'refs/heads/master'
run: node ./node_modules/beachball/bin/beachball.js publish -n ${{ secrets.NPM_AUTH }} --yes -m "applying package updates ***NO_CI***"
# - name: Beachball Publish (for other branches)
# if: github.ref != 'refs/heads/master'
# run: node ./node_modules/beachball/bin/beachball.js publish --tag $(Build.SourceBranchName) -n ${{ secrets.NPM_AUTH }} --yes -m "applying package updates ***NO_CI***"
#
- name: Create versionEnvVars script
run: node ./.ado/setVersionEnvVars.js
env:
RUNNER_TEMP: ${{ runner.temp }}
- uses: actions/upload-artifact@master
name: Publish VersionEnvVars
with:
name: VersionEnvVars
path: ${{ runner.temp }}/versionEnvVars
RnwNativePublishBuild:
name: vnext Windows.sln
needs: [RnwNpmPublish]
runs-on: windows-2016
strategy:
matrix:
BuildConfiguration: [Debug, Release]
BuildPlatform: [x64, x86, arm]
steps:
- name: Checkout
uses: actions/checkout@v1
- uses: actions/download-artifact@master
with:
name: VersionEnvVars
path: ${{ runner.temp }}/versionEnvVars
# This sets some env vars that we use to generate the correct version information in the dll and nuget
- run: node ${{ runner.temp }}/versionEnvVars/versionEnvVars.js
- name: yarn install
run: yarn install --frozen-lockfile
- run: yarn build
- name: Install SDK
run: .\vnext\Scripts\Install-WindowsSdkISO.ps1 18362
shell: powershell
- name: Setup Nuget.exe
uses: warrenbuckley/Setup-Nuget@v1
- name: NuGet restore
run: nuget.exe restore vnext\ReactWindows.sln -PackagesDirectory vnext/packages/ -Verbosity Detailed -NonInteractive
- name: Setup MSBuild.exe
uses: warrenbuckley/Setup-MSBuild@v1
- name: Build ReactWindows.sln
run: msbuild vnext\ReactWindows.sln /nologo /nr:false /p:PreferredToolArchitecture=x64 /p:platform="${{ matrix.BuildPlatform }}" /p:configuration="${{ matrix.BuildConfiguration}}" /clp:NoSummary;NoItemAndPropertyList;Verbosity=normal
- name: "Copy Nuget source files"
if: matrix.BuildConfiguration == 'Debug' && matrix.BuildPlatform == 'x86'
run: vnext\layoutFilesForNuget.bat ${{ runner.temp }}\artifacts
- uses: actions/upload-artifact@master
if: matrix.BuildConfiguration == 'Debug'
name: Publish Artifacts (Debug)
with:
name: ReactWindows-debug-${{ matrix.BuildPlatform }}
path: vnext/target/${{ matrix.BuildPlatform }}/${{ matrix.BuildConfiguration }}
- uses: actions/upload-artifact@master
if: matrix.BuildConfiguration == 'Release'
name: Publish Artifacts (Release)
with:
name: ReactWindows-ship-${{ matrix.BuildPlatform }}
path: vnext/target/${{ matrix.BuildPlatform }}/${{ matrix.BuildConfiguration }}
- uses: actions/upload-artifact@master
name: Publish Artifacts - Nuget Source files
if: matrix.BuildConfiguration == 'Debug' && matrix.BuildPlatform == 'x86'
with:
name: ReactWindows-source
path: ${{ runner.temp }}\artifacts
RNWNugetPublish:
name: React-Native-Windows Build and Pack Nuget
runs-on: windows-2016
needs: RnwNativePublishBuild
steps:
- name: Setup Nuget.exe
uses: warrenbuckley/Setup-Nuget@v1
- uses: actions/download-artifact@master
with:
name: VersionEnvVars
path: ${{ runner.temp }}/versionEnvVars
# This sets some env vars that we use to generate the correct version information in the dll and nuget
- run: node ${{ runner.temp }}/versionEnvVars/versionEnvVars.js
- uses: actions/download-artifact@master
with:
name: ReactWindows-debug-arm
path: ${{ runner.temp }}\artifacts\ReactWindows-debug-arm
- uses: actions/download-artifact@master
with:
name: ReactWindows-ship-arm
path: ${{ runner.temp }}\artifacts\ReactWindows-ship-arm
- uses: actions/download-artifact@master
with:
name: ReactWindows-debug-x86
path: ${{ runner.temp }}\artifacts\ReactWindows-debug-x86
- uses: actions/download-artifact@master
with:
name: ReactWindows-ship-x86
path: ${{ runner.temp }}\artifacts\ReactWindows-ship-x86
- uses: actions/download-artifact@master
with:
name: ReactWindows-debug-x64
path: ${{ runner.temp }}\artifacts\ReactWindows-debug-x64
- uses: actions/download-artifact@master
with:
name: ReactWindows-ship-x64
path: ${{ runner.temp }}\artifacts\ReactWindows-ship-x64
- uses: actions/download-artifact@master
with:
name: ReactWindows-source
path: ${{ runner.temp }}\artifacts\ReactWindows-source
- name: Copy files from build artifacts to nuget root
run: |
robocopy ${{ runner.temp }}\artifacts\ReactWindows-source ${{ runner.temp }}\NugetRoot /E /MOVE /NP
robocopy ${{ runner.temp }}\artifacts\ReactWindows-debug-x64 ${{ runner.temp }}\NugetRoot\target\x64\Debug /E /MOVE /NP
robocopy ${{ runner.temp }}\artifacts\ReactWindows-debug-x86 ${{ runner.temp }}\NugetRoot\target\x86\Debug /E /MOVE /NP
robocopy ${{ runner.temp }}\artifacts\ReactWindows-ship-x64 ${{ runner.temp }}\NugetRoot\target\x64\ship /E /MOVE /NP
robocopy ${{ runner.temp }}\artifacts\ReactWindows-ship-x86 ${{ runner.temp }}\NugetRoot\target\x86\ship /E /MOVE /NP
robocopy ${{ runner.temp }}\artifacts\ReactWindows-debug-arm ${{ runner.temp }}\NugetRoot\target\arm\debug /E /MOVE /NP
robocopy ${{ runner.temp }}\artifacts\ReactWindows-ship-arm ${{ runner.temp }}\NugetRoot\target\arm\ship /E /MOVE /NP
echo This makes errorlevel 0
dir c:\
- name: NuGet Pack ReactUwp
run: nuget pack ${{ runner.temp }}\NugetRoot\ReactUwp.nuspec -OutputDirectory ${{ runner.temp }}\NugetRootFinal -Properties CommitId=%publishCommitId%;npmVersion=%npmVersion%
- name: NuGet Pack ReactWin32
run: nuget pack ${{ runner.temp }}\NugetRoot\ReactWin32.nuspec -OutputDirectory ${{ runner.temp }}\NugetRootFinal -Properties CommitId=%publishCommitId%;npmVersion=%npmVersion%
- name: Set NuGet source
run: nuget sources add -name nugetfeed -source ${{ secrets.NUGET_FEED }} -username rnwpublish -password ${{ secrets.NUGET_AUTH }}
- name: Publish NuGet
run: for %%i in (${{ runner.temp }}\NugetRootFinal\*.nupkg) do nuget push %%i -Source ${{ secrets.NUGET_FEED }} -ApiKey rnwpublish