Kelvin Zhang | d64c883 | 2022-04-02 19:56:24 +0800 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # |
| 3 | # Copyright (c) 2021-2022 Amlogic, Inc. All rights reserved. |
| 4 | # |
| 5 | # SPDX-License-Identifier: MIT |
| 6 | # |
| 7 | |
Kelvin Zhang | dfd2838 | 2022-04-02 20:32:27 +0800 | [diff] [blame] | 8 | source scripts/publish.sh |
Kelvin Zhang | d64c883 | 2022-04-02 19:56:24 +0800 | [diff] [blame] | 9 | |
shijie.xiong | 69cbf04 | 2022-04-22 13:32:39 +0800 | [diff] [blame^] | 10 | function 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 Zhang | d64c883 | 2022-04-02 19:56:24 +0800 | [diff] [blame] | 17 | if [[ "$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 |
| 31 | fi |
| 32 | |
| 33 | # Manually cherry pick patches |
| 34 | ./scripts/cherry_pick.sh |
| 35 | |
| 36 | source scripts/gen_package_combination.sh |
| 37 | |
| 38 | index=0 |
| 39 | while 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.xiong | 69cbf04 | 2022-04-22 13:32:39 +0800 | [diff] [blame^] | 43 | get_new_package_dir |
Kelvin Zhang | d64c883 | 2022-04-02 19:56:24 +0800 | [diff] [blame] | 44 | [ "$?" -ne 0 ] && echo "Failed to make!" && exit 3 |
| 45 | if [[ "$SUBMIT_TYPE" == "release" ]]; then |
Kelvin Zhang | aa84d88 | 2022-04-22 13:38:46 +0800 | [diff] [blame] | 46 | publish_packages |
| 47 | [ "$?" -ne 0 ] && echo "Failed to publish packages!" && exit 4 |
Kelvin Zhang | d64c883 | 2022-04-02 19:56:24 +0800 | [diff] [blame] | 48 | fi |
| 49 | index=$((index + 1)) |
| 50 | done <"$PACKAGE_COMBINATION" |
| 51 | |
| 52 | echo "Build completed!" |