blob: 917348b059e5fcc722638ef887330de82c9db4c4 [file] [log] [blame]
Kelvin Zhangd64c8832022-04-02 19:56:24 +08001#!/bin/bash
2#
3# Copyright (c) 2021-2022 Amlogic, Inc. All rights reserved.
4#
5# SPDX-License-Identifier: MIT
6#
7
Kelvin Zhangdfd28382022-04-02 20:32:27 +08008source scripts/publish.sh
Kelvin Zhangd64c8832022-04-02 19:56:24 +08009
shijie.xiong69cbf042022-04-22 13:32:39 +080010function get_new_package_dir() {
11 filelist=$(ls -t output/packages)
12 fileArry=($filelist)
13 CURRENT_PRODUCTS_DIR_NAME=${fileArry[0]}
14 export CURRENT_PRODUCTS_DIR_NAME
15}
16
Kelvin Zhangd64c8832022-04-02 19:56:24 +080017if [[ "$SUBMIT_TYPE" == "daily" ]] || [[ "$SUBMIT_TYPE" == "release" ]]; then
18 make docs
19 if [ -d $LOCAL_DOC_PATH ]; then
20 pushd $LOCAL_DOC_PATH >/dev/null
21 publish_docoment
22 if [ $? -ne 0 ]; then
23 echo "Failed to update document"
24 else
25 echo "Document updated!"
26 fi
27 popd >/dev/null
28 else
29 echo "$LOCAL_DOC_PATH not exist!"
30 fi
31fi
32
33# Manually cherry pick patches
34./scripts/cherry_pick.sh
35
36source scripts/gen_package_combination.sh
37
38index=0
39while IFS= read -r LINE; do
40 source scripts/pkg_env.sh $index gen_all
41 [ "$?" -ne 0 ] && echo "Ignore unsupported combination!" && continue
42 make package
shijie.xiong69cbf042022-04-22 13:32:39 +080043 get_new_package_dir
Kelvin Zhangd64c8832022-04-02 19:56:24 +080044 [ "$?" -ne 0 ] && echo "Failed to make!" && exit 3
45 if [[ "$SUBMIT_TYPE" == "release" ]]; then
Kelvin Zhangaa84d882022-04-22 13:38:46 +080046 publish_packages
47 [ "$?" -ne 0 ] && echo "Failed to publish packages!" && exit 4
Kelvin Zhangd64c8832022-04-02 19:56:24 +080048 fi
49 index=$((index + 1))
50done <"$PACKAGE_COMBINATION"
51
52echo "Build completed!"