2019-11-22 02:25:46 +03:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
set +x
|
2020-04-20 12:38:13 +03:00
|
|
|
set -o pipefail
|
2019-11-22 02:25:46 +03:00
|
|
|
|
|
|
|
if [[ ($1 == '--help') || ($1 == '-h') ]]; then
|
2021-10-28 03:20:23 +03:00
|
|
|
echo "usage: $(basename "$0") [firefox-linux|firefox-win64|webkit-gtk|webkit-wpe|webkit-gtk-wpe|webkit-win64|webkit-mac-10.15] [-f|--force]"
|
2019-11-22 02:25:46 +03:00
|
|
|
echo
|
2020-03-07 19:37:47 +03:00
|
|
|
echo "Prepares checkout under browser folder, applies patches, builds, archives, and uploads if build is missing."
|
2019-11-22 02:25:46 +03:00
|
|
|
echo "Script will bail out early if the build for the browser version is already present."
|
|
|
|
echo
|
|
|
|
echo "Pass -f to upload anyway."
|
|
|
|
echo
|
|
|
|
echo "NOTE: This script is safe to run in a cronjob - it aquires a lock so that it does not run twice."
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ $# == 0 ]]; then
|
2020-01-18 01:23:31 +03:00
|
|
|
echo "missing build flavor!"
|
2021-08-07 15:32:18 +03:00
|
|
|
echo "try './$(basename "$0") --help' for more information"
|
2019-11-22 02:25:46 +03:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2020-12-09 04:15:44 +03:00
|
|
|
CURRENT_ARCH="$(uname -m)"
|
2020-01-18 01:23:31 +03:00
|
|
|
CURRENT_HOST_OS="$(uname)"
|
|
|
|
CURRENT_HOST_OS_VERSION=""
|
|
|
|
if [[ "$CURRENT_HOST_OS" == "Darwin" ]]; then
|
|
|
|
CURRENT_HOST_OS_VERSION=$(sw_vers -productVersion | grep -o '^\d\+.\d\+')
|
2020-07-23 21:59:23 +03:00
|
|
|
elif [[ "$CURRENT_HOST_OS" == "Linux" ]]; then
|
|
|
|
CURRENT_HOST_OS="$(bash -c 'source /etc/os-release && echo $NAME')"
|
|
|
|
CURRENT_HOST_OS_VERSION="$(bash -c 'source /etc/os-release && echo $VERSION_ID')"
|
2020-01-18 01:23:31 +03:00
|
|
|
fi
|
|
|
|
|
2019-11-22 02:25:46 +03:00
|
|
|
BROWSER_NAME=""
|
2021-06-16 02:01:11 +03:00
|
|
|
BROWSER_DISPLAY_NAME=""
|
2020-01-11 04:30:35 +03:00
|
|
|
EXTRA_BUILD_ARGS=""
|
2021-02-18 01:43:19 +03:00
|
|
|
EXTRA_ARCHIVE_ARGS=""
|
2020-01-18 01:23:31 +03:00
|
|
|
BUILD_FLAVOR="$1"
|
2020-04-20 11:25:25 +03:00
|
|
|
BUILD_BLOB_NAME=""
|
2020-01-18 01:23:31 +03:00
|
|
|
EXPECTED_HOST_OS=""
|
|
|
|
EXPECTED_HOST_OS_VERSION=""
|
2020-12-09 04:15:44 +03:00
|
|
|
EXPECTED_ARCH="x86_64"
|
2021-06-16 02:01:11 +03:00
|
|
|
BUILDS_LIST="EXPECTED_BUILDS"
|
2021-02-18 01:43:19 +03:00
|
|
|
|
|
|
|
# ===========================
|
|
|
|
# WINLDD COMPILATION
|
|
|
|
# ===========================
|
2020-09-18 19:43:43 +03:00
|
|
|
if [[ "$BUILD_FLAVOR" == "winldd-win64" ]]; then
|
|
|
|
BROWSER_NAME="winldd"
|
|
|
|
EXPECTED_HOST_OS="MINGW"
|
|
|
|
BUILD_BLOB_NAME="winldd-win64.zip"
|
2021-02-18 01:43:19 +03:00
|
|
|
|
|
|
|
|
|
|
|
# ===========================
|
|
|
|
# FFMPEG COMPILATION
|
|
|
|
# ===========================
|
2020-09-18 19:43:43 +03:00
|
|
|
elif [[ "$BUILD_FLAVOR" == "ffmpeg-mac" ]]; then
|
2020-09-10 03:05:08 +03:00
|
|
|
BROWSER_NAME="ffmpeg"
|
2021-12-23 01:59:10 +03:00
|
|
|
EXTRA_BUILD_ARGS="--mac --full"
|
2020-09-10 03:05:08 +03:00
|
|
|
EXPECTED_HOST_OS="Darwin"
|
2021-10-09 00:11:39 +03:00
|
|
|
EXPECTED_HOST_OS_VERSION="11.6"
|
2020-09-10 03:05:08 +03:00
|
|
|
BUILD_BLOB_NAME="ffmpeg-mac.zip"
|
2021-12-23 01:43:13 +03:00
|
|
|
elif [[ "$BUILD_FLAVOR" == "ffmpeg-mac-arm64" ]]; then
|
|
|
|
BROWSER_NAME="ffmpeg"
|
2021-12-23 01:59:10 +03:00
|
|
|
EXTRA_BUILD_ARGS="--mac --full"
|
2021-12-23 01:43:13 +03:00
|
|
|
EXPECTED_HOST_OS="Darwin"
|
|
|
|
EXPECTED_HOST_OS_VERSION="11.6"
|
|
|
|
EXPECTED_ARCH="arm64"
|
|
|
|
BUILD_BLOB_NAME="ffmpeg-mac-arm64.zip"
|
2020-09-15 01:12:35 +03:00
|
|
|
elif [[ "$BUILD_FLAVOR" == "ffmpeg-linux" ]]; then
|
|
|
|
BROWSER_NAME="ffmpeg"
|
|
|
|
EXTRA_BUILD_ARGS="--linux"
|
|
|
|
EXPECTED_HOST_OS="Ubuntu"
|
|
|
|
EXPECTED_HOST_OS_VERSION="20.04"
|
|
|
|
BUILD_BLOB_NAME="ffmpeg-linux.zip"
|
2021-11-02 22:02:16 +03:00
|
|
|
elif [[ "$BUILD_FLAVOR" == "ffmpeg-linux-arm64" ]]; then
|
|
|
|
BROWSER_NAME="ffmpeg"
|
|
|
|
EXTRA_BUILD_ARGS="--cross-compile-linux-arm64"
|
|
|
|
EXPECTED_HOST_OS="Ubuntu"
|
|
|
|
EXPECTED_HOST_OS_VERSION="20.04"
|
|
|
|
BUILD_BLOB_NAME="ffmpeg-linux-arm64.zip"
|
2020-09-10 03:05:08 +03:00
|
|
|
elif [[ "$BUILD_FLAVOR" == "ffmpeg-cross-compile-win64" ]]; then
|
|
|
|
BROWSER_NAME="ffmpeg"
|
|
|
|
EXTRA_BUILD_ARGS="--cross-compile-win64"
|
|
|
|
EXPECTED_HOST_OS="Ubuntu"
|
|
|
|
EXPECTED_HOST_OS_VERSION="20.04"
|
|
|
|
BUILD_BLOB_NAME="ffmpeg-win64.zip"
|
2021-02-18 01:43:19 +03:00
|
|
|
|
|
|
|
# ===========================
|
|
|
|
# CHROMIUM COMPILATION
|
|
|
|
# ===========================
|
2021-02-08 10:54:10 +03:00
|
|
|
elif [[ "$BUILD_FLAVOR" == "chromium-win64" ]]; then
|
|
|
|
BROWSER_NAME="chromium"
|
2022-03-24 00:04:57 +03:00
|
|
|
EXTRA_BUILD_ARGS="--full --goma"
|
2021-02-08 10:54:10 +03:00
|
|
|
EXPECTED_HOST_OS="MINGW"
|
|
|
|
BUILD_BLOB_NAME="chromium-win64.zip"
|
2021-01-28 12:14:44 +03:00
|
|
|
elif [[ "$BUILD_FLAVOR" == "chromium-mac" ]]; then
|
|
|
|
BROWSER_NAME="chromium"
|
2022-03-24 00:04:57 +03:00
|
|
|
EXTRA_BUILD_ARGS="--full --goma"
|
2021-01-28 12:14:44 +03:00
|
|
|
EXPECTED_HOST_OS="Darwin"
|
2022-02-17 23:21:13 +03:00
|
|
|
EXPECTED_HOST_OS_VERSION="12.2"
|
2021-01-28 12:14:44 +03:00
|
|
|
BUILD_BLOB_NAME="chromium-mac.zip"
|
2021-01-22 11:27:40 +03:00
|
|
|
elif [[ "$BUILD_FLAVOR" == "chromium-mac-arm64" ]]; then
|
|
|
|
BROWSER_NAME="chromium"
|
2022-03-24 00:04:57 +03:00
|
|
|
EXTRA_BUILD_ARGS="--arm64 --full --goma"
|
2021-01-22 11:27:40 +03:00
|
|
|
EXPECTED_HOST_OS="Darwin"
|
2022-02-17 23:21:13 +03:00
|
|
|
EXPECTED_HOST_OS_VERSION="12.2"
|
2021-01-22 11:27:40 +03:00
|
|
|
BUILD_BLOB_NAME="chromium-mac-arm64.zip"
|
2021-01-27 19:42:35 +03:00
|
|
|
elif [[ "$BUILD_FLAVOR" == "chromium-linux" ]]; then
|
|
|
|
BROWSER_NAME="chromium"
|
2022-03-24 00:04:57 +03:00
|
|
|
EXTRA_BUILD_ARGS="--full --goma"
|
2021-01-27 19:42:35 +03:00
|
|
|
EXPECTED_HOST_OS="Ubuntu"
|
|
|
|
EXPECTED_HOST_OS_VERSION="18.04"
|
|
|
|
BUILD_BLOB_NAME="chromium-linux.zip"
|
2021-10-28 23:42:41 +03:00
|
|
|
elif [[ "$BUILD_FLAVOR" == "chromium-linux-arm64" ]]; then
|
|
|
|
BROWSER_NAME="chromium"
|
2022-03-24 00:04:57 +03:00
|
|
|
EXTRA_BUILD_ARGS="--arm64 --full --goma"
|
2021-10-28 23:42:41 +03:00
|
|
|
EXPECTED_HOST_OS="Ubuntu"
|
2021-11-01 22:43:39 +03:00
|
|
|
EXPECTED_HOST_OS_VERSION="20.04"
|
2021-10-28 23:42:41 +03:00
|
|
|
BUILD_BLOB_NAME="chromium-linux-arm64.zip"
|
2021-02-18 01:43:19 +03:00
|
|
|
|
2021-06-15 11:18:00 +03:00
|
|
|
# ===========================
|
|
|
|
# CHROMIUM-WITH-SYMBOLS COMPILATION
|
|
|
|
# ===========================
|
|
|
|
elif [[ "$BUILD_FLAVOR" == "chromium-with-symbols-win64" ]]; then
|
|
|
|
BROWSER_NAME="chromium"
|
2021-06-16 02:01:11 +03:00
|
|
|
BROWSER_DISPLAY_NAME="chromium-with-symbols"
|
2022-03-24 00:04:57 +03:00
|
|
|
EXTRA_BUILD_ARGS="--symbols --full --goma"
|
2021-06-15 11:18:00 +03:00
|
|
|
EXPECTED_HOST_OS="MINGW"
|
|
|
|
BUILD_BLOB_NAME="chromium-with-symbols-win64.zip"
|
2021-06-16 02:01:11 +03:00
|
|
|
BUILDS_LIST="EXPECTED_BUILDS_WITH_SYMBOLS"
|
2021-06-15 11:18:00 +03:00
|
|
|
elif [[ "$BUILD_FLAVOR" == "chromium-with-symbols-mac" ]]; then
|
|
|
|
BROWSER_NAME="chromium"
|
2021-06-16 02:01:11 +03:00
|
|
|
BROWSER_DISPLAY_NAME="chromium-with-symbols"
|
2022-03-24 00:04:57 +03:00
|
|
|
EXTRA_BUILD_ARGS="--symbols --full --goma"
|
2021-06-15 11:18:00 +03:00
|
|
|
EXPECTED_HOST_OS="Darwin"
|
2022-02-17 23:21:13 +03:00
|
|
|
EXPECTED_HOST_OS_VERSION="12.2"
|
2021-06-15 11:18:00 +03:00
|
|
|
BUILD_BLOB_NAME="chromium-with-symbols-mac.zip"
|
2021-06-16 02:01:11 +03:00
|
|
|
BUILDS_LIST="EXPECTED_BUILDS_WITH_SYMBOLS"
|
2021-06-15 11:18:00 +03:00
|
|
|
elif [[ "$BUILD_FLAVOR" == "chromium-with-symbols-mac-arm64" ]]; then
|
|
|
|
BROWSER_NAME="chromium"
|
2021-06-16 02:01:11 +03:00
|
|
|
BROWSER_DISPLAY_NAME="chromium-with-symbols"
|
2022-03-24 00:04:57 +03:00
|
|
|
EXTRA_BUILD_ARGS="--arm64 --symbols --full --goma"
|
2021-06-15 11:18:00 +03:00
|
|
|
EXPECTED_HOST_OS="Darwin"
|
2022-02-17 23:21:13 +03:00
|
|
|
EXPECTED_HOST_OS_VERSION="12.2"
|
2021-06-15 11:18:00 +03:00
|
|
|
BUILD_BLOB_NAME="chromium-with-symbols-mac-arm64.zip"
|
2021-06-16 02:01:11 +03:00
|
|
|
BUILDS_LIST="EXPECTED_BUILDS_WITH_SYMBOLS"
|
2021-06-15 11:18:00 +03:00
|
|
|
elif [[ "$BUILD_FLAVOR" == "chromium-with-symbols-linux" ]]; then
|
|
|
|
BROWSER_NAME="chromium"
|
2021-06-16 02:01:11 +03:00
|
|
|
BROWSER_DISPLAY_NAME="chromium-with-symbols"
|
2022-03-24 00:04:57 +03:00
|
|
|
EXTRA_BUILD_ARGS="--symbols --full --goma"
|
2021-06-15 11:18:00 +03:00
|
|
|
EXPECTED_HOST_OS="Ubuntu"
|
|
|
|
EXPECTED_HOST_OS_VERSION="18.04"
|
|
|
|
BUILD_BLOB_NAME="chromium-with-symbols-linux.zip"
|
2021-06-16 02:01:11 +03:00
|
|
|
BUILDS_LIST="EXPECTED_BUILDS_WITH_SYMBOLS"
|
2021-10-28 23:42:41 +03:00
|
|
|
elif [[ "$BUILD_FLAVOR" == "chromium-with-symbols-linux-arm64" ]]; then
|
|
|
|
BROWSER_NAME="chromium"
|
|
|
|
BROWSER_DISPLAY_NAME="chromium-with-symbols-arm64"
|
2022-03-24 00:04:57 +03:00
|
|
|
EXTRA_BUILD_ARGS="--arm64 --symbols --full --goma"
|
2021-10-28 23:42:41 +03:00
|
|
|
EXPECTED_HOST_OS="Ubuntu"
|
2021-11-02 11:05:49 +03:00
|
|
|
EXPECTED_HOST_OS_VERSION="20.04"
|
2021-10-28 23:42:41 +03:00
|
|
|
BUILD_BLOB_NAME="chromium-with-symbols-linux-arm64.zip"
|
|
|
|
BUILDS_LIST="EXPECTED_BUILDS_WITH_SYMBOLS"
|
2021-06-15 11:18:00 +03:00
|
|
|
|
2021-02-18 01:43:19 +03:00
|
|
|
# ===========================
|
|
|
|
# FIREFOX COMPILATION
|
|
|
|
# ===========================
|
2020-08-08 02:22:05 +03:00
|
|
|
elif [[ "$BUILD_FLAVOR" == "firefox-ubuntu-18.04" ]]; then
|
2020-01-18 01:23:31 +03:00
|
|
|
BROWSER_NAME="firefox"
|
2021-02-03 08:35:12 +03:00
|
|
|
EXTRA_BUILD_ARGS="--full"
|
2020-07-23 21:59:23 +03:00
|
|
|
EXPECTED_HOST_OS="Ubuntu"
|
|
|
|
EXPECTED_HOST_OS_VERSION="18.04"
|
|
|
|
BUILD_BLOB_NAME="firefox-ubuntu-18.04.zip"
|
2021-04-03 00:16:25 +03:00
|
|
|
elif [[ "$BUILD_FLAVOR" == "firefox-ubuntu-20.04" ]]; then
|
|
|
|
BROWSER_NAME="firefox"
|
|
|
|
EXTRA_BUILD_ARGS="--full"
|
|
|
|
EXPECTED_HOST_OS="Ubuntu"
|
|
|
|
EXPECTED_HOST_OS_VERSION="20.04"
|
|
|
|
BUILD_BLOB_NAME="firefox-ubuntu-20.04.zip"
|
2021-11-05 22:15:34 +03:00
|
|
|
elif [[ "$BUILD_FLAVOR" == "firefox-ubuntu-20.04-arm64" ]]; then
|
|
|
|
BROWSER_NAME="firefox"
|
|
|
|
EXTRA_BUILD_ARGS="--full --linux-arm64"
|
|
|
|
EXTRA_ARCHIVE_ARGS="--linux-arm64"
|
|
|
|
EXPECTED_HOST_OS="Ubuntu"
|
|
|
|
EXPECTED_HOST_OS_VERSION="20.04"
|
|
|
|
BUILD_BLOB_NAME="firefox-ubuntu-20.04-arm64.zip"
|
2021-10-08 02:23:00 +03:00
|
|
|
elif [[ "$BUILD_FLAVOR" == "firefox-mac-11" ]]; then
|
2020-01-18 01:23:31 +03:00
|
|
|
BROWSER_NAME="firefox"
|
2021-02-03 08:35:12 +03:00
|
|
|
EXTRA_BUILD_ARGS="--full"
|
2020-01-18 01:23:31 +03:00
|
|
|
EXPECTED_HOST_OS="Darwin"
|
2021-10-08 02:23:00 +03:00
|
|
|
EXPECTED_HOST_OS_VERSION="11.6"
|
|
|
|
EXPECTED_ARCH="x86_64"
|
|
|
|
BUILD_BLOB_NAME="firefox-mac-11.zip"
|
2021-10-07 23:56:08 +03:00
|
|
|
elif [[ "$BUILD_FLAVOR" == "firefox-mac-11-arm64" ]]; then
|
2021-01-12 03:57:59 +03:00
|
|
|
BROWSER_NAME="firefox"
|
2021-02-03 08:35:12 +03:00
|
|
|
EXTRA_BUILD_ARGS="--full"
|
2021-01-12 03:57:59 +03:00
|
|
|
EXPECTED_HOST_OS="Darwin"
|
2021-10-07 23:56:08 +03:00
|
|
|
EXPECTED_HOST_OS_VERSION="11.6"
|
2021-01-12 03:57:59 +03:00
|
|
|
EXPECTED_ARCH="arm64"
|
2021-10-07 23:56:08 +03:00
|
|
|
BUILD_BLOB_NAME="firefox-mac-11-arm64.zip"
|
2020-01-18 01:23:31 +03:00
|
|
|
elif [[ "$BUILD_FLAVOR" == "firefox-win64" ]]; then
|
2020-01-11 04:30:35 +03:00
|
|
|
BROWSER_NAME="firefox"
|
2021-10-28 03:20:23 +03:00
|
|
|
EXTRA_BUILD_ARGS="--full"
|
2020-01-18 01:23:31 +03:00
|
|
|
EXPECTED_HOST_OS="MINGW"
|
2020-04-20 11:25:25 +03:00
|
|
|
BUILD_BLOB_NAME="firefox-win64.zip"
|
2022-03-05 01:34:22 +03:00
|
|
|
# This is the architecture that is set by mozilla-build bash.
|
|
|
|
EXPECTED_ARCH="i686"
|
2021-02-18 01:43:19 +03:00
|
|
|
|
|
|
|
|
2021-04-10 08:13:19 +03:00
|
|
|
# ===============================
|
2021-06-08 03:05:51 +03:00
|
|
|
# FIREFOX-BETA COMPILATION
|
2021-04-10 08:13:19 +03:00
|
|
|
# ===============================
|
2021-06-08 03:05:51 +03:00
|
|
|
elif [[ "$BUILD_FLAVOR" == "firefox-beta-ubuntu-18.04" ]]; then
|
|
|
|
BROWSER_NAME="firefox-beta"
|
2021-04-10 08:13:19 +03:00
|
|
|
EXTRA_BUILD_ARGS="--full"
|
|
|
|
EXPECTED_HOST_OS="Ubuntu"
|
|
|
|
EXPECTED_HOST_OS_VERSION="18.04"
|
2021-06-08 03:05:51 +03:00
|
|
|
BUILD_BLOB_NAME="firefox-beta-ubuntu-18.04.zip"
|
|
|
|
elif [[ "$BUILD_FLAVOR" == "firefox-beta-ubuntu-20.04" ]]; then
|
|
|
|
BROWSER_NAME="firefox-beta"
|
2021-04-10 08:13:19 +03:00
|
|
|
EXTRA_BUILD_ARGS="--full"
|
|
|
|
EXPECTED_HOST_OS="Ubuntu"
|
|
|
|
EXPECTED_HOST_OS_VERSION="20.04"
|
2021-06-08 03:05:51 +03:00
|
|
|
BUILD_BLOB_NAME="firefox-beta-ubuntu-20.04.zip"
|
2021-10-08 02:23:00 +03:00
|
|
|
elif [[ "$BUILD_FLAVOR" == "firefox-beta-mac-11" ]]; then
|
2021-06-08 03:05:51 +03:00
|
|
|
BROWSER_NAME="firefox-beta"
|
2021-04-10 08:13:19 +03:00
|
|
|
EXTRA_BUILD_ARGS="--full"
|
|
|
|
EXPECTED_HOST_OS="Darwin"
|
2021-10-08 02:23:00 +03:00
|
|
|
EXPECTED_HOST_OS_VERSION="11.6"
|
|
|
|
EXPECTED_ARCH="x86_64"
|
|
|
|
BUILD_BLOB_NAME="firefox-beta-mac-11.zip"
|
2021-10-07 23:56:08 +03:00
|
|
|
elif [[ "$BUILD_FLAVOR" == "firefox-beta-mac-11-arm64" ]]; then
|
2021-06-08 03:05:51 +03:00
|
|
|
BROWSER_NAME="firefox-beta"
|
2021-04-10 08:13:19 +03:00
|
|
|
EXTRA_BUILD_ARGS="--full"
|
|
|
|
EXPECTED_HOST_OS="Darwin"
|
2021-10-07 23:56:08 +03:00
|
|
|
EXPECTED_HOST_OS_VERSION="11.6"
|
2021-04-10 08:13:19 +03:00
|
|
|
EXPECTED_ARCH="arm64"
|
2021-10-07 23:56:08 +03:00
|
|
|
BUILD_BLOB_NAME="firefox-beta-mac-11-arm64.zip"
|
2021-06-08 03:05:51 +03:00
|
|
|
elif [[ "$BUILD_FLAVOR" == "firefox-beta-win64" ]]; then
|
|
|
|
BROWSER_NAME="firefox-beta"
|
2021-10-28 03:20:23 +03:00
|
|
|
EXTRA_BUILD_ARGS="--full"
|
2021-04-10 08:13:19 +03:00
|
|
|
EXPECTED_HOST_OS="MINGW"
|
2021-06-08 03:05:51 +03:00
|
|
|
BUILD_BLOB_NAME="firefox-beta-win64.zip"
|
2022-03-03 06:30:29 +03:00
|
|
|
# This is the architecture that is set by mozilla-build bash.
|
|
|
|
EXPECTED_ARCH="i686"
|
2021-04-10 08:13:19 +03:00
|
|
|
|
2021-02-18 01:43:19 +03:00
|
|
|
# ===========================
|
|
|
|
# WEBKIT COMPILATION
|
|
|
|
# ===========================
|
2020-07-24 01:57:53 +03:00
|
|
|
elif [[ "$BUILD_FLAVOR" == "webkit-ubuntu-18.04" ]]; then
|
2020-01-18 03:37:49 +03:00
|
|
|
BROWSER_NAME="webkit"
|
2020-10-27 07:53:27 +03:00
|
|
|
EXTRA_BUILD_ARGS="--full"
|
2020-07-23 21:59:23 +03:00
|
|
|
EXPECTED_HOST_OS="Ubuntu"
|
|
|
|
EXPECTED_HOST_OS_VERSION="18.04"
|
2020-07-24 10:31:18 +03:00
|
|
|
BUILD_BLOB_NAME="webkit-ubuntu-18.04.zip"
|
2020-07-24 01:57:53 +03:00
|
|
|
elif [[ "$BUILD_FLAVOR" == "webkit-ubuntu-20.04" ]]; then
|
2020-07-24 00:42:14 +03:00
|
|
|
BROWSER_NAME="webkit"
|
2020-10-27 07:53:27 +03:00
|
|
|
EXTRA_BUILD_ARGS="--full"
|
2020-07-24 00:42:14 +03:00
|
|
|
EXPECTED_HOST_OS="Ubuntu"
|
|
|
|
EXPECTED_HOST_OS_VERSION="20.04"
|
2020-07-24 10:31:18 +03:00
|
|
|
BUILD_BLOB_NAME="webkit-ubuntu-20.04.zip"
|
2021-11-08 12:04:59 +03:00
|
|
|
elif [[ "$BUILD_FLAVOR" == "webkit-ubuntu-20.04-arm64" ]]; then
|
|
|
|
BROWSER_NAME="webkit"
|
|
|
|
EXTRA_BUILD_ARGS="--full"
|
|
|
|
EXPECTED_HOST_OS="Ubuntu"
|
|
|
|
EXPECTED_HOST_OS_VERSION="20.04"
|
|
|
|
EXPECTED_ARCH="aarch64"
|
|
|
|
BUILD_BLOB_NAME="webkit-ubuntu-20.04-arm64.zip"
|
2020-01-18 01:23:31 +03:00
|
|
|
elif [[ "$BUILD_FLAVOR" == "webkit-win64" ]]; then
|
|
|
|
BROWSER_NAME="webkit"
|
|
|
|
EXPECTED_HOST_OS="MINGW"
|
2020-07-24 10:31:18 +03:00
|
|
|
BUILD_BLOB_NAME="webkit-win64.zip"
|
2020-01-18 01:23:31 +03:00
|
|
|
elif [[ "$BUILD_FLAVOR" == "webkit-mac-10.15" ]]; then
|
2019-11-22 02:25:46 +03:00
|
|
|
BROWSER_NAME="webkit"
|
2020-01-18 01:23:31 +03:00
|
|
|
EXPECTED_HOST_OS="Darwin"
|
|
|
|
EXPECTED_HOST_OS_VERSION="10.15"
|
2020-07-24 10:31:18 +03:00
|
|
|
BUILD_BLOB_NAME="webkit-mac-10.15.zip"
|
2021-12-22 00:45:37 +03:00
|
|
|
elif [[ "$BUILD_FLAVOR" == "webkit-mac-12" ]]; then
|
|
|
|
BROWSER_NAME="webkit"
|
|
|
|
EXPECTED_HOST_OS="Darwin"
|
2022-02-14 20:30:36 +03:00
|
|
|
EXPECTED_HOST_OS_VERSION="12.2"
|
2021-12-22 00:45:37 +03:00
|
|
|
BUILD_BLOB_NAME="webkit-mac-12.zip"
|
2021-12-22 19:03:10 +03:00
|
|
|
elif [[ "$BUILD_FLAVOR" == "webkit-mac-12-arm64" ]]; then
|
|
|
|
BROWSER_NAME="webkit"
|
|
|
|
EXPECTED_HOST_OS="Darwin"
|
2022-02-14 20:30:36 +03:00
|
|
|
EXPECTED_HOST_OS_VERSION="12.2"
|
2021-12-22 19:03:10 +03:00
|
|
|
EXPECTED_ARCH="arm64"
|
|
|
|
BUILD_BLOB_NAME="webkit-mac-12-arm64.zip"
|
2022-03-14 20:54:19 +03:00
|
|
|
elif [[ "$BUILD_FLAVOR" == "webkit-mac-11" ]]; then
|
|
|
|
BROWSER_NAME="webkit"
|
|
|
|
EXPECTED_HOST_OS="Darwin"
|
|
|
|
EXPECTED_HOST_OS_VERSION="11.6"
|
|
|
|
BUILD_BLOB_NAME="webkit-mac-11.zip"
|
2021-10-07 23:56:08 +03:00
|
|
|
elif [[ "$BUILD_FLAVOR" == "webkit-mac-11-arm64" ]]; then
|
2020-12-09 04:15:44 +03:00
|
|
|
BROWSER_NAME="webkit"
|
|
|
|
EXPECTED_HOST_OS="Darwin"
|
2021-10-07 23:56:08 +03:00
|
|
|
EXPECTED_HOST_OS_VERSION="11.6"
|
2020-12-09 04:15:44 +03:00
|
|
|
EXPECTED_ARCH="arm64"
|
2021-10-07 23:56:08 +03:00
|
|
|
BUILD_BLOB_NAME="webkit-mac-11-arm64.zip"
|
2021-03-16 11:08:21 +03:00
|
|
|
|
|
|
|
|
2021-08-25 17:44:28 +03:00
|
|
|
# ===========================
|
|
|
|
# Unknown input
|
|
|
|
# ===========================
|
2019-11-22 02:25:46 +03:00
|
|
|
else
|
2020-01-18 01:23:31 +03:00
|
|
|
echo ERROR: unknown build flavor - "$BUILD_FLAVOR"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2021-06-16 02:01:11 +03:00
|
|
|
if [[ -z "$BROWSER_DISPLAY_NAME" ]]; then
|
|
|
|
BROWSER_DISPLAY_NAME="${BROWSER_NAME}"
|
|
|
|
fi
|
|
|
|
|
2020-12-10 19:43:42 +03:00
|
|
|
if [[ "$CURRENT_ARCH" != "$EXPECTED_ARCH" ]]; then
|
2020-12-09 04:15:44 +03:00
|
|
|
echo "ERROR: cannot build $BUILD_FLAVOR"
|
|
|
|
echo " -- expected arch: $EXPECTED_ARCH"
|
|
|
|
echo " -- current arch: $CURRENT_ARCH"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2020-01-18 01:23:31 +03:00
|
|
|
if [[ "$CURRENT_HOST_OS" != $EXPECTED_HOST_OS* ]]; then
|
|
|
|
echo "ERROR: cannot build $BUILD_FLAVOR"
|
|
|
|
echo " -- expected OS: $EXPECTED_HOST_OS"
|
|
|
|
echo " -- current OS: $CURRENT_HOST_OS"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ "$CURRENT_HOST_OS_VERSION" != "$EXPECTED_HOST_OS_VERSION" ]]; then
|
|
|
|
echo "ERROR: cannot build $BUILD_FLAVOR"
|
|
|
|
echo " -- expected OS Version: $EXPECTED_HOST_OS_VERSION"
|
|
|
|
echo " -- current OS Version: $CURRENT_HOST_OS_VERSION"
|
2019-11-22 02:25:46 +03:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2022-04-01 01:09:38 +03:00
|
|
|
if [[ $(uname) == MINGW* || "$(uname)" == MSYS* ]]; then
|
2019-11-23 04:16:47 +03:00
|
|
|
ZIP_PATH="$PWD/archive-$BROWSER_NAME.zip"
|
2020-04-20 11:25:25 +03:00
|
|
|
LOG_PATH="$PWD/log-$BROWSER_NAME.zip"
|
2019-11-23 04:16:47 +03:00
|
|
|
else
|
|
|
|
ZIP_PATH="/tmp/archive-$BROWSER_NAME.zip"
|
2020-04-20 11:25:25 +03:00
|
|
|
LOG_PATH="/tmp/log-$BROWSER_NAME.zip"
|
2019-11-23 04:16:47 +03:00
|
|
|
fi
|
|
|
|
|
2021-08-07 15:32:18 +03:00
|
|
|
if [[ -f "$ZIP_PATH" ]]; then
|
2019-11-22 02:25:46 +03:00
|
|
|
echo "Archive $ZIP_PATH already exists - remove and re-run the script."
|
|
|
|
exit 1
|
|
|
|
fi
|
2020-04-20 11:25:25 +03:00
|
|
|
trap "rm -rf ${ZIP_PATH}; rm -rf ${LOG_PATH}; cd $(pwd -P);" INT TERM EXIT
|
2019-11-22 02:25:46 +03:00
|
|
|
cd "$(dirname "$0")"
|
2020-07-02 22:09:27 +03:00
|
|
|
BUILD_NUMBER=$(head -1 ./$BROWSER_NAME/BUILD_NUMBER)
|
2020-04-20 11:25:25 +03:00
|
|
|
BUILD_BLOB_PATH="${BROWSER_NAME}/${BUILD_NUMBER}/${BUILD_BLOB_NAME}"
|
2020-04-20 14:24:18 +03:00
|
|
|
LOG_BLOB_NAME="${BUILD_BLOB_NAME%.zip}.log.gz"
|
|
|
|
LOG_BLOB_PATH="${BROWSER_NAME}/${BUILD_NUMBER}/${LOG_BLOB_NAME}"
|
2019-11-22 02:25:46 +03:00
|
|
|
|
|
|
|
# pull from upstream and check if a new build has to be uploaded.
|
|
|
|
if ! [[ ($2 == '-f') || ($2 == '--force') ]]; then
|
2020-04-20 11:25:25 +03:00
|
|
|
if ./upload.sh "${BUILD_BLOB_PATH}" --check; then
|
2019-11-22 02:25:46 +03:00
|
|
|
echo "Build is already uploaded - no changes."
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo "Force-rebuilding the build."
|
|
|
|
fi
|
|
|
|
|
2020-04-20 11:25:25 +03:00
|
|
|
function generate_and_upload_browser_build {
|
2020-01-18 03:55:42 +03:00
|
|
|
echo "-- preparing checkout"
|
|
|
|
if ! ./prepare_checkout.sh $BROWSER_NAME; then
|
2020-04-20 12:38:13 +03:00
|
|
|
return 20
|
2020-01-18 03:37:49 +03:00
|
|
|
fi
|
2019-12-10 01:38:23 +03:00
|
|
|
|
2020-01-18 03:55:42 +03:00
|
|
|
echo "-- cleaning"
|
|
|
|
if ! ./$BROWSER_NAME/clean.sh; then
|
2020-04-20 12:38:13 +03:00
|
|
|
return 21
|
2020-01-18 03:55:42 +03:00
|
|
|
fi
|
2019-11-23 07:49:40 +03:00
|
|
|
|
2020-01-18 03:55:42 +03:00
|
|
|
echo "-- building"
|
2021-08-30 17:48:40 +03:00
|
|
|
if ! ./$BROWSER_NAME/build.sh $EXTRA_BUILD_ARGS; then
|
2020-04-20 12:38:13 +03:00
|
|
|
return 22
|
2020-01-18 03:55:42 +03:00
|
|
|
fi
|
2019-11-23 07:49:40 +03:00
|
|
|
|
2020-01-18 03:55:42 +03:00
|
|
|
echo "-- archiving to $ZIP_PATH"
|
2021-08-30 17:48:40 +03:00
|
|
|
if ! ./$BROWSER_NAME/archive.sh "$ZIP_PATH" $EXTRA_ARCHIVE_ARGS; then
|
2020-05-01 22:09:36 +03:00
|
|
|
return 23
|
2020-01-18 03:55:42 +03:00
|
|
|
fi
|
2019-11-23 07:49:40 +03:00
|
|
|
|
2020-04-20 11:25:25 +03:00
|
|
|
echo "-- uploading"
|
2021-08-07 15:32:18 +03:00
|
|
|
if ! ./upload.sh "$BUILD_BLOB_PATH" "$ZIP_PATH"; then
|
2020-05-01 22:09:36 +03:00
|
|
|
return 24
|
2020-04-20 11:25:25 +03:00
|
|
|
fi
|
|
|
|
return 0
|
|
|
|
}
|
2020-02-07 23:42:09 +03:00
|
|
|
|
2021-08-17 15:23:40 +03:00
|
|
|
function create_roll_into_playwright_pr {
|
|
|
|
curl -X POST \
|
|
|
|
-H "Accept: application/vnd.github.v3+json" \
|
|
|
|
-H "Authorization: token ${GH_TOKEN}" \
|
2021-08-17 15:32:53 +03:00
|
|
|
--data '{"event_type": "roll_into_pw", "client_payload": {"browser": "'"$1"'", "revision": "'"$2"'"}}' \
|
2021-08-17 15:23:40 +03:00
|
|
|
https://api.github.com/repos/microsoft/playwright/dispatches
|
|
|
|
}
|
|
|
|
|
2021-02-22 20:09:19 +03:00
|
|
|
source ./send_telegram_message.sh
|
2020-04-20 11:25:25 +03:00
|
|
|
BUILD_ALIAS="$BUILD_FLAVOR r$BUILD_NUMBER"
|
|
|
|
send_telegram_message "$BUILD_ALIAS -- started"
|
2020-02-07 23:42:09 +03:00
|
|
|
|
2020-04-20 12:38:13 +03:00
|
|
|
if generate_and_upload_browser_build 2>&1 | ./sanitize_and_compress_log.js $LOG_PATH; then
|
2021-06-16 02:01:11 +03:00
|
|
|
# Report successful build. Note: MINGW might not have `du` command.
|
2021-02-20 01:43:27 +03:00
|
|
|
UPLOAD_SIZE=""
|
|
|
|
if command -v du >/dev/null && command -v awk >/dev/null; then
|
|
|
|
UPLOAD_SIZE="$(du -h "$ZIP_PATH" | awk '{print $1}') "
|
2020-04-20 11:25:25 +03:00
|
|
|
fi
|
2021-02-20 01:43:27 +03:00
|
|
|
send_telegram_message "$BUILD_ALIAS -- ${UPLOAD_SIZE}uploaded"
|
|
|
|
|
2020-04-20 11:25:25 +03:00
|
|
|
# Check if we uploaded the last build.
|
2021-06-16 02:01:11 +03:00
|
|
|
(
|
|
|
|
for i in $(cat "${BROWSER_NAME}/${BUILDS_LIST}"); do
|
2021-06-16 20:38:00 +03:00
|
|
|
URL="https://playwright2.blob.core.windows.net/builds/${BROWSER_NAME}/${BUILD_NUMBER}/$i"
|
2021-08-07 15:32:18 +03:00
|
|
|
if ! [[ $(curl -s -L -I "$URL" | head -1 | cut -f2 -d' ') == 200 ]]; then
|
2021-06-16 02:01:11 +03:00
|
|
|
# Exit subshell
|
|
|
|
echo "Missing build at ${URL}"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
done;
|
|
|
|
LAST_COMMIT_MESSAGE=$(git log --format=%s -n 1 HEAD -- "./${BROWSER_NAME}/BUILD_NUMBER")
|
2022-02-16 01:00:15 +03:00
|
|
|
CHECKMARK_CHAR=$(printf '\xe2\x9c\x85')
|
|
|
|
send_telegram_message "<b>${BROWSER_DISPLAY_NAME} r${BUILD_NUMBER} COMPLETE! ${CHECKMARK_CHAR}</b> ${LAST_COMMIT_MESSAGE}"
|
2021-10-28 00:47:55 +03:00
|
|
|
if [[ "${BROWSER_DISPLAY_NAME}" != "chromium-with-symbols" ]]; then
|
|
|
|
create_roll_into_playwright_pr $BROWSER_NAME $BUILD_NUMBER
|
|
|
|
fi
|
2021-06-16 02:01:11 +03:00
|
|
|
)
|
2020-04-20 11:25:25 +03:00
|
|
|
else
|
2020-04-20 12:38:13 +03:00
|
|
|
RESULT_CODE="$?"
|
|
|
|
if (( RESULT_CODE == 10 )); then
|
|
|
|
FAILED_STEP="./download_gtk_and_wpe_and_zip_together.sh"
|
|
|
|
elif (( RESULT_CODE == 11 )); then
|
|
|
|
FAILED_STEP="./upload.sh"
|
|
|
|
elif (( RESULT_CODE == 20 )); then
|
|
|
|
FAILED_STEP="./prepare_checkout.sh"
|
|
|
|
elif (( RESULT_CODE == 21 )); then
|
|
|
|
FAILED_STEP="./clean.sh"
|
|
|
|
elif (( RESULT_CODE == 22 )); then
|
|
|
|
FAILED_STEP="./build.sh"
|
|
|
|
elif (( RESULT_CODE == 23 )); then
|
2020-05-01 03:42:52 +03:00
|
|
|
FAILED_STEP="./archive.sh"
|
2020-05-01 22:09:36 +03:00
|
|
|
elif (( RESULT_CODE == 24 )); then
|
2020-04-20 12:38:13 +03:00
|
|
|
FAILED_STEP="./upload.sh"
|
|
|
|
else
|
|
|
|
FAILED_STEP="<unknown step>"
|
|
|
|
fi
|
2020-04-20 11:25:25 +03:00
|
|
|
# Upload logs only in case of failure and report failure.
|
2021-08-07 15:32:18 +03:00
|
|
|
./upload.sh "${LOG_BLOB_PATH}" ${LOG_PATH} || true
|
2022-02-16 01:00:15 +03:00
|
|
|
CROSS_CHAR=$(printf '\xe2\x9d\x8c')
|
|
|
|
send_telegram_message "$BUILD_ALIAS -- ${FAILED_STEP} failed! ${CROSS_CHAR} <a href='https://playwright.azureedge.net/builds/${LOG_BLOB_PATH}'>${LOG_BLOB_NAME}</a> -- <a href='$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID'>GitHub Action Logs</a>"
|
2021-02-20 01:43:27 +03:00
|
|
|
exit 1
|
2020-04-20 11:25:25 +03:00
|
|
|
fi
|
2020-02-07 23:42:09 +03:00
|
|
|
|