You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by tz...@apache.org on 2020/03/26 08:13:05 UTC

[flink-statefun] 02/02: [release] Add tools script for creating Python SDK distributions

This is an automated email from the ASF dual-hosted git repository.

tzulitai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink-statefun.git

commit 797cad71f0cba2570e630f4b9391e53ec0ec4f94
Author: Tzu-Li (Gordon) Tai <tz...@apache.org>
AuthorDate: Thu Mar 26 16:11:48 2020 +0800

    [release] Add tools script for creating Python SDK distributions
---
 tools/releasing/create_python_sdk_release.sh | 81 ++++++++++++++++++++++++++++
 1 file changed, 81 insertions(+)

diff --git a/tools/releasing/create_python_sdk_release.sh b/tools/releasing/create_python_sdk_release.sh
new file mode 100755
index 0000000..ea1b326
--- /dev/null
+++ b/tools/releasing/create_python_sdk_release.sh
@@ -0,0 +1,81 @@
+#!/usr/bin/env bash
+
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+##
+## Variables with defaults (if not overwritten by environment)
+##
+SKIP_GPG=${SKIP_GPG:-false}
+MVN=${MVN:-mvn}
+
+##
+## Required variables
+##
+RELEASE_VERSION=${RELEASE_VERSION}
+
+if [ -z "${RELEASE_VERSION}" ]; then
+    echo "RELEASE_VERSION was not set."
+    exit 1
+fi
+
+# fail immediately
+set -o errexit
+set -o nounset
+
+if [ "$(uname)" == "Darwin" ]; then
+    SHASUM="shasum -a 512"
+else
+    SHASUM="sha512sum"
+fi
+
+CURR_DIR=`pwd`
+BASE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
+PROJECT_ROOT="${BASE_DIR}/../../"
+
+# Sanity check to ensure that resolved paths are valid; a LICENSE file should aways exist in project root
+if [ ! -f ${PROJECT_ROOT}/LICENSE ]; then
+    echo "Project root path ${PROJECT_ROOT} is not valid; script may be in the wrong directory."
+    exit 1
+fi
+
+###########################
+
+RELEASE_DIR=${PROJECT_ROOT}/release/
+mkdir -p ${RELEASE_DIR}
+
+cd ${PROJECT_ROOT}/statefun-python-sdk/
+./build-distribution.sh
+
+mv dist/* ${RELEASE_DIR}
+
+SOURCE_DIST="apache-flink-statefun-$RELEASE_VERSION.tar.gz"
+WHL_VERSION=`echo "$RELEASE_VERSION" | tr - _`
+WHL_DIST="apache_flink_statefun-$WHL_VERSION-py3-none-any.whl"
+
+cd ${RELEASE_DIR}
+# Sign sha the files
+if [ "$SKIP_GPG" == "false" ] ; then
+    gpg --armor --detach-sig ${SOURCE_DIST}
+    gpg --armor --detach-sig ${WHL_DIST}
+fi
+${SHASUM} "${SOURCE_DIST}" > "${SOURCE_DIST}.sha512"
+${SHASUM} "${WHL_DIST}" > "${WHL_DIST}.sha512"
+
+echo "Created Python SDK distribution files at $RELEASE_DIR."
+
+cd ${CURR_DIR}