Skip to content

Commit 041fb23

Browse files
committed
update react-native-windows on publish
1 parent 0afcec7 commit 041fb23

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

.ado/updateRNW.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// @ts-check
2+
// This will trigger the evergreen build in the react-native-windows repo to update to the latest build of react-native
3+
4+
const request = require('request');
5+
6+
const url =
7+
'https://api.github.com/repos/microsoft/react-native-windows/dispatches';
8+
request.post(
9+
{
10+
url: url,
11+
json: true,
12+
headers: {
13+
Authorization: 'Basic ' + new Buffer(":" + process.env.GIT_TOKEN).toString("base64"),
14+
'Content-Type': 'application/json',
15+
'User-Agent': 'RNW-Evergreen Script',
16+
Accept: 'application/vnd.github.everest-preview+json',
17+
},
18+
body: {
19+
event_type: 'evergreen',
20+
},
21+
},
22+
function(err, httpResponse, _body) {
23+
if (err) {
24+
throw new Error(err);
25+
}
26+
27+
if (httpResponse.statusCode != 204) {
28+
throw new Error('Failed to trigger build.');
29+
}
30+
},
31+
);

.github/workflows/publish.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,8 @@ jobs:
6363
- name: Publish NuGet
6464
run: |
6565
for %%i in (${{ runner.temp }}\final\*.nupkg) do nuget push %%i -Source ${{ secrets.NUGET_FEED }} -ApiKey msrnpublish
66+
67+
- name: Update react-native-windows
68+
run: node .ado/updateRNW.js
69+
env:
70+
GIT_TOKEN: ${{ secrets.GIT_TOKEN }}

0 commit comments

Comments
 (0)