Update script to build release artifacts
@@ -23,9 +23,11 @@ set -o errexit
set -o nounset
set -o pipefail
+source "$(dirname "${BASH_SOURCE}")/util.sh"
+
RELEASE_TAG="${1-}"
-if [[ ! "${RELEASE_TAG}" ]]; then
- >&2 echo "usage: $0 <release tag of the form v[0-9]+.[0-9]+.[0-9]+>"
+if [[ ! "${RELEASE_TAG}" =~ ${RELEASE_TAG_REGEX} ]]; then
+ >&2 echo "usage: $0 <release tag of the form v[0-9]+.[0-9]+.[0-9]+(-rc[0-9]+)?>"
exit 1
fi
@@ -37,8 +39,12 @@ command -v helm >/dev/null 2>&1 ||
ROOT_DIR="$(cd "$(dirname "$0")/.." ; pwd)"
RELEASE_VERSION="${RELEASE_TAG:1:${#RELEASE_TAG}-1}"
+# This file name is used by the create github release script. If modifying,
+# also update it there as well.
+ASSETS_FILE="kubefed-${RELEASE_TAG}-asset-files.txt"
pushd "${ROOT_DIR}"
+ rm -f "${ROOT_DIR}/${ASSETS_FILE}"
# Build release artifacts for kubefedctl
arch=amd64
for host_os in linux darwin; do
@@ -50,6 +56,7 @@ pushd "${ROOT_DIR}"
tar cvzf "${TAR_FILENAME}" --transform="flags=r;s|${BINARY_FILENAME}|kubefedctl|" "${BINARY_FILENAME}"
sha256sum "${TAR_FILENAME}" > "${TAR_FILENAME}.sha"
mv "${TAR_FILENAME}" "${TAR_FILENAME}.sha" "${ROOT_DIR}/"
+ echo -e "${TAR_FILENAME}\n${TAR_FILENAME}.sha" >> "${ROOT_DIR}/${ASSETS_FILE}"
popd
done
@@ -68,6 +75,7 @@ pushd "${ROOT_DIR}"
sha256sum "kubefed-${RELEASE_VERSION}.tgz" > "kubefed-${RELEASE_VERSION}.tgz.sha"
mv kubefed-${RELEASE_VERSION}.tgz* "${ROOT_DIR}/"
+ echo -e "kubefed-${RELEASE_VERSION}.tgz\nkubefed-${RELEASE_VERSION}.tgz.sha" >> "${ROOT_DIR}/${ASSETS_FILE}"
# Revert the chart changes (should not be committed)
mv kubefed/values.yaml.backup kubefed/values.yaml
