From 7ca08684c2d74e3ddb7d4c886250c7e9e4802a9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B8=BF=E7=AB=A0?= Date: Tue, 14 Apr 2020 16:28:34 +0800 Subject: [PATCH] write sha256 checksum for wheel --- build/build.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/build/build.sh b/build/build.sh index 577907ac..ece20232 100755 --- a/build/build.sh +++ b/build/build.sh @@ -21,7 +21,7 @@ PROJECT_BASEDIR=$(dirname "$SCRIPT_BASEDIR") rename_wheel() { cd "$PROJECT_BASEDIR/output" || exit - VERSION="$1" + VERSION="$("$PYTHON" -c 'import platform; print(platform.python_version())')" PACKAGE_LIST=$(ls mindinsight-*-any.whl) || exit for PACKAGE_ORIG in $PACKAGE_LIST; do MINDINSIGHT_VERSION=$(echo "$PACKAGE_ORIG" | awk -F"-" '{print $2}') @@ -35,6 +35,14 @@ rename_wheel() { done } +write_checksum() { + cd "$PROJECT_BASEDIR/output" || exit + PACKAGE_LIST=$(ls mindinsight-*.whl) || exit + for PACKAGE_NAME in $PACKAGE_LIST; do + sha256sum -b "$PACKAGE_NAME" >"$PACKAGE_NAME.sha256" + done +} + build_wheel() { cd "$PROJECT_BASEDIR" || exit @@ -76,8 +84,8 @@ build_wheel() { mv dist output - rename_wheel "$("$PYTHON" -c 'import platform; print(platform.python_version())')" - + rename_wheel + write_checksum clean_files echo "Build success, output directory is: $PROJECT_BASEDIR/output"