mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
devops: add bot to auto bump Chromium (#7997)
This commit is contained in:
parent
7caef6f09f
commit
fcb8d5310a
47
.github/workflows/roll_chromium_build.yml
vendored
Normal file
47
.github/workflows/roll_chromium_build.yml
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
name: Trigger Chromium build
|
||||
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 linux = response.data.find(({os}) => os === 'linux');
|
||||
const linuxCanary = linux.versions.find(version => version.channel === 'canary');
|
||||
fs.writeFileSync('browser_patches/chromium/BUILD_NUMBER', `${linuxCanary.branch_base_position}\n`)
|
||||
core.setOutput('GIT_COMMIT', linuxCanary.chromium_commit);
|
||||
core.setOutput('BASE_POSITION', linuxCanary.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: 'master',
|
||||
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 }}',
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user