playwright/browser_patches/chromium/roll_to_current_beta.sh
Andrey Lushnikov 732afa7cb9
devops: switch chromium to build from chromium-beta branch (#13302)
This patch:
- switches `//browser_patches/chromium` to checkout and build
  chromium-beta branch
- introduces `//browser_patches/chromium/roll_to_current_beta.sh` script
  that pulls build configuration for beta from omaha proxy
- switches Github Action to pull daily to the latest beta

Drive-by: fix bug in argument parsing for Chromium building
2022-04-04 14:33:23 -07:00

33 lines
988 B
Bash
Executable File

#!/bin/bash
set -e
set +x
trap "cd $(pwd -P)" EXIT
cd "$(dirname "$0")"
SCRIPT_FOLDER=$(pwd -P)
# 1. get current version
CURRENT_BETA_VERSION=$(curl https://omahaproxy.appspot.com/all | grep "win64,beta" | cut -d ',' -f 3)
VERSION_INFO_JSON=$(curl "https://omahaproxy.appspot.com/deps.json?version=$CURRENT_BETA_VERSION")
NODE_SCRIPT=$(cat <<EOF
const json = JSON.parse(fs.readFileSync(0));
console.log([
'# CURRENT_VERSION: ' + json.chromium_version,
'# BRANCH_BASE_POSITION: ' + json.chromium_base_position,
'BRANCH_COMMIT="' + json.chromium_commit + '"',
].join('\n'));
EOF
)
NEW_CONFIG=$(echo "${VERSION_INFO_JSON}" | node -e "${NODE_SCRIPT}")
CURRENT_CONFIG=$(cat "${SCRIPT_FOLDER}/UPSTREAM_CONFIG.sh")
if [[ "${CURRENT_CONFIG}" == "${NEW_CONFIG}" ]]; then
echo "No changes!"
exit 0
fi
echo "${NEW_CONFIG}" > "${SCRIPT_FOLDER}/UPSTREAM_CONFIG.sh"
BUILD_NUMBER=$(cat "${SCRIPT_FOLDER}/BUILD_NUMBER")
echo $(( $BUILD_NUMBER + 1 )) > "${SCRIPT_FOLDER}/BUILD_NUMBER"