playwright/.github/workflows/roll_chromium_build.yml
2021-08-06 13:58:39 +02:00

47 lines
2.0 KiB
YAML

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 }}',
});