From fafa0e0a4f95578e721bb1d4af696ed6ce16a8a7 Mon Sep 17 00:00:00 2001 From: Tao Wang Date: Wed, 21 Dec 2016 01:51:08 +1100 Subject: [PATCH] Add checksum files of released binaries Add `sha256sum.txt` and `md5sum.txt` for release binaries. Also fixed a minor bug which `bin/docker-machine binary` shouldn't be shown in the released file list. Signed-off-by: Tao Wang --- script/release.sh | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/script/release.sh b/script/release.sh index 512bb02f..19fea153 100755 --- a/script/release.sh +++ b/script/release.sh @@ -139,11 +139,14 @@ CONTRIBUTORS=$(git log "${LAST_RELEASE_VERSION}".. --format="%aN" --reverse | so CHANGELOG=$(git log "${LAST_RELEASE_VERSION}".. --oneline | grep -v 'Merge pull request') CHECKSUM="" -for file in $(ls bin/docker-machine*); do +rm -f sha256sum.txt md5sum.txt +for file in $(ls bin/docker-machine-*); do SHA256=$(openssl dgst -sha256 < "${file}") MD5=$(openssl dgst -md5 < "${file}") LINE=$(printf "\n * **%s**\n * sha256 \`%s\`\n * md5 \`%s\`\n\n" "$(basename ${file})" "${SHA256}" "${MD5}") CHECKSUM="${CHECKSUM}${LINE}" + echo "${SHA256} ${file:4}" >> sha256sum.txt + echo "${MD5} ${file:4}" >> md5sum.txt done TEMPLATE=$(cat "${GITHUB_RELEASE_FILE}") @@ -229,6 +232,21 @@ for file in $(ls bin/docker-machine-*); do fi done +display "Uploading sha256sum.txt and md5sum.txt" +for file in sha256sum.txt md5sum.txt; do + display "Uploading ${file}..." + github-release upload \ + --security-token "${GITHUB_TOKEN}" \ + --user "${GITHUB_USER}" \ + --repo "${GITHUB_REPO}" \ + --tag "${GITHUB_VERSION}" \ + --name "$(basename "${file}")" \ + --file "${file}" + if [[ "$?" -ne 0 ]]; then + display "Could not upload ${file}, continuing with others" + fi +done + git remote rm remote.prod.url rm ${GITHUB_RELEASE_FILE}