From 5cfc8dee5ee8ef92e2900f5a17e850f018345ee3 Mon Sep 17 00:00:00 2001 From: Ta-Ching Chen Date: Thu, 28 Nov 2019 00:40:20 +0800 Subject: [PATCH] Push extra tag to fit go module semver tag format (#1444) --- hack/Releasing.txt | 5 ++--- hack/release.sh | 27 ++++++++++++++++++--------- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/hack/Releasing.txt b/hack/Releasing.txt index 6778360a..dfba6685 100644 --- a/hack/Releasing.txt +++ b/hack/Releasing.txt @@ -75,8 +75,7 @@ a. Switch to fission/fission-charts repo and run `index.sh` in that repo. (Don' b. You should have index.yaml and fission-core-*, fission-all-* charts as change, add, commit and push it to repo. - -8. Go to Github Web UI --> Releases, here you will notice a pre-release for the version x.y.z you just created. +9. Go to Github Web UI --> Releases, here you will notice a pre-release for the version x.y.z you just created. Edit it and add links to: @@ -88,7 +87,7 @@ Before you save the release - UNCHECK the "This is a pre-release" checkbox. This Updating Fission Docs (https://github.com/fission/docs.fission.io) ------------------------------ -9. Documentation Update +10. Documentation Update a. Merge documentation PRs that are peer reviewed and get latest master locally. diff --git a/hack/release.sh b/hack/release.sh index 916906ba..acffca57 100755 --- a/hack/release.sh +++ b/hack/release.sh @@ -14,8 +14,8 @@ check_branch() { curr_branch=$(git rev-parse --abbrev-ref HEAD) if [ $curr_branch != "release-${version}" ] then - echo "Not on release-${version} branch." - exit 1 + echo "Not on release-${version} branch." + exit 1 fi } @@ -23,8 +23,8 @@ check_branch() { check_clean() { if ! git diff-index --quiet HEAD -- then - echo "Unclean tree" - exit 1 + echo "Unclean tree" + exit 1 fi } @@ -150,13 +150,22 @@ push_all() { tag_and_release() { local version=$1 - local gittag="v${version}" + local gittag=$version + local prefix="v" + local gopkgtag=${version/#/${prefix}} + + if [[ ${version} == v* ]]; # if version starts with "v", don't append prefix. + then + gopkgtag=${version} + fi # tag the release git tag $gittag - + git tag -a $gopkgtag -m "Fission $gopkgtag" + # push tag git push origin $gittag + git push origin $gopkgtag # create gh release gothub release \ @@ -170,7 +179,7 @@ tag_and_release() { attach_github_release_cli() { local version=$1 - local gittag="v${version}" + local gittag=$version # cli echo "Uploading osx cli" gothub upload \ @@ -202,7 +211,7 @@ attach_github_release_cli() { attach_github_release_charts() { local version=$1 - local gittag="v${version}" + local gittag=$version # helm charts gothub upload \ @@ -225,7 +234,7 @@ attach_github_release_charts() { attach_github_release_yamls() { local version=$1 - local gittag="v${version}" + local gittag=$version for c in fission-all fission-core do