From fcb8d5310adae942c61ceb08982a9aa7dba1a756 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Fri, 6 Aug 2021 13:58:39 +0200 Subject: [PATCH] devops: add bot to auto bump Chromium (#7997) --- .github/workflows/roll_chromium_build.yml | 47 +++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/roll_chromium_build.yml diff --git a/.github/workflows/roll_chromium_build.yml b/.github/workflows/roll_chromium_build.yml new file mode 100644 index 0000000000..b11b48d71c --- /dev/null +++ b/.github/workflows/roll_chromium_build.yml @@ -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 }}', + }); \ No newline at end of file