forked from microsoft/playwright
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (47 loc) · 2.05 KB
/
roll_chromium_build.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
name: "PR: bump //browser_patches/chromium/BUILD_NUMBER"
on:
workflow_dispatch:
schedule:
# At 10:00am UTC (3AM PST) on Monday and Friday
- cron: "0 10 * * 1,5"
jobs:
trigger-chromium-build:
name: Trigger Build
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/github-script@v4
id: bump-chromium
with:
script: |
const fs = require('fs');
const response = await github.request('https://omahaproxy.appspot.com/all.json');
const win = response.data.find(({os}) => os === 'win');
const winCanary = win.versions.find(version => version.channel === 'canary');
fs.writeFileSync('browser_patches/chromium/BUILD_NUMBER', `${winCanary.branch_base_position}\n`)
core.setOutput('GIT_COMMIT', winCanary.chromium_commit);
core.setOutput('BASE_POSITION', winCanary.branch_base_position);
- name: Prepare branch
id: prepare-branch
run: |
BASE_POSITION="${{ steps.bump-chromium.outputs.BASE_POSITION }}"
BRANCH_NAME="roll-chromium/${BASE_POSITION}"
echo "::set-output name=BRANCH_NAME::$BRANCH_NAME"
git config --global user.name github-actions
git config --global user.email 41898282+github-actions[bot]@users.noreply.github.com
git checkout -b "$BRANCH_NAME"
git add .
git commit -m "browser(chromium): roll to r${BASE_POSITION}"
git push origin $BRANCH_NAME
- name: Create Pull Request
uses: actions/github-script@v4
with:
script: |
await github.pulls.create({
owner: 'microsoft',
repo: 'playwright',
head: 'microsoft:${{ steps.prepare-branch.outputs.BRANCH_NAME }}',
base: 'main',
title: 'browser(chromium): roll to r${{ steps.bump-chromium.outputs.BASE_POSITION }}',
body: 'Upstream commit: https://github.com/chromium/chromium/commit/${{ steps.bump-chromium.outputs.GIT_COMMIT }}',
});