From 1ecb277a832f5e2453b8957e300d892380061d45 Mon Sep 17 00:00:00 2001 From: Yee <2520865+yixinglu@users.noreply.github.com> Date: Wed, 5 Jan 2022 20:35:06 +0800 Subject: [PATCH] Cleanup branch param in package script (#3622) --- .github/workflows/rc.yml | 2 +- package/package.sh | 19 +++++++------------ 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/.github/workflows/rc.yml b/.github/workflows/rc.yml index 7b0e0797791..2891dd7a0ce 100644 --- a/.github/workflows/rc.yml +++ b/.github/workflows/rc.yml @@ -40,7 +40,7 @@ jobs: - uses: ./.github/actions/tagname-action id: tag - name: package - run: ./package/package.sh -b ${{ steps.tag.outputs.tag }} -t RelWithDebInfo -r OFF -p ON -s TRUE + run: ./package/package.sh -v ${{ steps.tag.outputs.tag }} -t RelWithDebInfo -r OFF -p ON -s TRUE - name: output some vars run: | tar zcf ${{ env.CPACK_DIR }}/nebula-${{ steps.tag.outputs.tagnum }}.tar.gz --exclude=${{ env.BUILD_DIR }} ./* diff --git a/package/package.sh b/package/package.sh index 23abc71482f..299bdbc2ece 100755 --- a/package/package.sh +++ b/package/package.sh @@ -6,14 +6,13 @@ # -v: The version of package, the version should be match tag name, default value is null # -n: Package to one or multi-packages, `ON` means one package, `OFF` means multi packages, default value is `ON` # -s: Whether to strip the package, default value is `FALSE` -# -b: Branch, default master # -d: Whether to enable sanitizer, default OFF # -t: Build type, default Release # -j: Number of threads, default $(nproc) # -r: Whether enable compressed debug info, default ON # -p: Whether dump the symbols from binary by dump_syms # -# usage: ./package.sh -v -n -s -b +# usage: ./package.sh -v -n -s # set -e @@ -21,13 +20,13 @@ set -e version="" package_one=ON strip_enable="FALSE" -usage="Usage: ${0} -v -n -s -b -g -j -t " +usage="Usage: ${0} -v -n -s -g -j -t " project_dir="$(cd "$(dirname "$0")" && pwd)/.." build_dir=${project_dir}/pkg-build enablesanitizer="OFF" static_sanitizer="OFF" build_type="Release" -branch="master" +branch=$(git rev-parse --abbrev-ref HEAD) jobs=$(nproc) enable_compressed_debug_info=ON dump_symbols=OFF @@ -47,9 +46,6 @@ do s) strip_enable=$OPTARG ;; - b) - branch=$OPTARG - ;; d) enablesanitizer="ON" if [ "$OPTARG" == "static" ]; then @@ -135,9 +131,8 @@ function build { san=$2 ssan=$3 build_type=$4 - branch=$5 - package_tar=$6 - install_prefix=$7 + package_tar=$5 + install_prefix=$6 mkdir -p ${build_dir} @@ -210,7 +205,7 @@ function dump_syms { } # The main -build $version $enablesanitizer $static_sanitizer $build_type $branch "OFF" "/usr/local/nebula" +build $version $enablesanitizer $static_sanitizer $build_type "OFF" "/usr/local/nebula" package $strip_enable if [[ $dump_symbols == ON ]]; then echo ">>> start dump symbols <<<" @@ -218,5 +213,5 @@ if [[ $dump_symbols == ON ]]; then fi # tar package -build $version $enablesanitizer $static_sanitizer $build_type $branch "ON" "/" +build $version $enablesanitizer $static_sanitizer $build_type "ON" "/" package $strip_enable