From a468ef7b455aa097ea573aeb35681fc19d753a4c Mon Sep 17 00:00:00 2001 From: k911 Date: Sat, 30 Nov 2019 14:18:39 +0100 Subject: [PATCH] Revert "ci(circle): Remove loop in bash release script" This reverts commit ed058cbab947a455c4324a867f078d755bd423bd. Issue #81 has probably been caused by CircleCI feature called "auto-cancel redundant builds". When release script pushed a new commit to master branch build was cancelled, because default branch for this repository is `develop`, and builds are not cancelled automatically with this feature only for default branches. --- .circleci/release-version.sh | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.circleci/release-version.sh b/.circleci/release-version.sh index e232f62f..67e545a7 100755 --- a/.circleci/release-version.sh +++ b/.circleci/release-version.sh @@ -116,15 +116,18 @@ else fi # Push commit and tag - -if [ "0" = "$DRY_RUN" ]; then - GH_TOKEN="${GH_TOKEN:?"Provide \"GH_TOKEN\" variable with GitHub Personal Access Token"}" - git remote add authorized "https://${GH_COMMITER_NAME}:${GH_TOKEN}@github.com/${GH_REPOSITORY}.git" - git push authorized "$RELEASE_TAG" - git push authorized HEAD:master - git push authorized HEAD:develop - git remote remove authorized -fi +GH_TOKEN="${GH_TOKEN:?"Provide \"GH_TOKEN\" variable with GitHub Personal Access Token"}" +REVS="$RELEASE_TAG HEAD:master HEAD:develop" + +git remote add authorized "https://${GH_COMMITER_NAME}:${GH_TOKEN}@github.com/${GH_REPOSITORY}.git" +for REV in $REVS; do + if [ "0" = "$DRY_RUN" ]; then + git push authorized "$REV" + else + echo "Pushing $REV.." + fi +done +git remote remove authorized # Make github release GH_RELEASE_DRAFT="${GH_RELEASE_DRAFT:-false}"