From ff6aa827f0cb9cae9e2d71bf47303266192e5996 Mon Sep 17 00:00:00 2001 From: yclchuxue <75575291+yclchuxue@users.noreply.github.com> Date: Thu, 19 May 2022 22:06:07 +0800 Subject: [PATCH] feat: auto-release-darwin-arm64.sh improvement * feat: auto-release-darwin-arm64.sh improvement * chore: some minor improvement with auto-release-darwin-arm64.sh Signed-off-by: Daniel Hu Co-authored-by: yclchuxue Co-authored-by: Daniel Hu --- .../release}/auto-release-darwin-arm64.sh | 26 ++++++++++++++++--- .../package => hack/release}/upload_assets.sh | 0 2 files changed, 22 insertions(+), 4 deletions(-) rename {build/package => hack/release}/auto-release-darwin-arm64.sh (70%) rename {build/package => hack/release}/upload_assets.sh (100%) diff --git a/build/package/auto-release-darwin-arm64.sh b/hack/release/auto-release-darwin-arm64.sh similarity index 70% rename from build/package/auto-release-darwin-arm64.sh rename to hack/release/auto-release-darwin-arm64.sh index 361217aa2..d77522a8b 100755 --- a/build/package/auto-release-darwin-arm64.sh +++ b/hack/release/auto-release-darwin-arm64.sh @@ -1,7 +1,27 @@ #! /bin/bash -e +# usage: `sh auto-release-darwin-arm64.sh -t v0.6.0` set -o nounset -tag=v0.5.0 +tag="invalid" + +while getopts "t:" opt; do + case $opt in + t) + tag=$OPTARG + ;; + + ?) + echo "Options not used" + exit 1 + ;; + esac +done + +if [ "${tag}" == "invalid" ]; then + echo "Maybe you forgot to use -t flag. E.g. sh auto-release-darwin-arm64.sh -t v0.6.0" + exit 1 +fi +echo "tag: ${tag}" user=devstream-io repo=devstream @@ -32,8 +52,6 @@ make build -j8 # install github-release for uploading go install github.com/github-release/github-release@latest - - # upload dtm echo 'Uploading 'dtm-${GOOS}-${GOARCH}' ...' github-release upload --security-token $github_token --user $user --repo $repo --tag $tag --file dtm --name dtm-${GOOS}-${GOARCH} @@ -42,4 +60,4 @@ echo dtm-${GOOS}-${GOARCH}' uploaded.' # upload plugins and .md5 files # In order to upload plug-ins to s3, you need to download awscli. After downloading awscli, you need to configure aws credentials. pip3 install awscli -aws s3 cp $plugin_dir s3://download.devstream.io/${tag} --recursive --acl public-read +aws s3 cp $plugin_dir s3://download.devstream.io/${tag} --recursive --acl public-read diff --git a/build/package/upload_assets.sh b/hack/release/upload_assets.sh similarity index 100% rename from build/package/upload_assets.sh rename to hack/release/upload_assets.sh