From 62715d158bfc0bb1d135b746df2b565ab350ccc4 Mon Sep 17 00:00:00 2001 From: Sebastian Spaink <3441183+sspaink@users.noreply.github.com> Date: Thu, 10 Jun 2021 11:12:14 -0500 Subject: [PATCH] Fix Mac script to install go (#9345) Co-authored-by: reimda --- scripts/check-file-changes.sh | 8 ++++++-- scripts/mac_installgo.sh | 8 ++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/scripts/check-file-changes.sh b/scripts/check-file-changes.sh index 4897f2d3f..fa141afc4 100755 --- a/scripts/check-file-changes.sh +++ b/scripts/check-file-changes.sh @@ -1,7 +1,11 @@ #!/bin/bash +# To prevent the tests/builds to run for only a doc change, this script checks what files have changed in a pull request. BRANCH="$(git rev-parse --abbrev-ref HEAD)" echo $BRANCH -if [[ "$BRANCH" != "master" ]]; then - git diff master --name-only --no-color | egrep -e "^(\.circleci\/.*)|(.*\.(go|mod|sum))|Makefile$" || circleci step halt; +if [[ "$BRANCH" != "master" ]] && [[ "$BRANCH" != release* ]]; then # This should never skip for master and release branches + # Ask git for all the differences between this branch and master + # Then use grep to look for changes in the .circleci/ directory, anything named *.go or *.mod or *.sum or *.sh or Makefile + # If no match is found, then circleci step halt will stop the CI job but mark it successful + git diff master --name-only --no-color | egrep -e "^(\.circleci\/.*)$|^(.*\.(go|mod|sum|sh))$|^Makefile$" || circleci step halt; fi diff --git a/scripts/mac_installgo.sh b/scripts/mac_installgo.sh index 6d1923773..285db8b31 100644 --- a/scripts/mac_installgo.sh +++ b/scripts/mac_installgo.sh @@ -3,8 +3,8 @@ set -eux GO_ARCH="darwin-amd64" -GO_VERSION="1.16.2" -GO_VERSION_SHA="c98cde81517c5daf427f3071412f39d5bc58f6120e90a0d94cc51480fa04dbc1" # from https://golang.org/dl +GO_VERSION="1.16.5" +GO_VERSION_SHA="be761716d5bfc958a5367440f68ba6563509da2f539ad1e1864bd42fe553f277" # from https://golang.org/dl # This path is cachable. (Saving in /usr/local/ would cause issues restoring the cache.) path="/usr/local/Cellar" @@ -13,8 +13,8 @@ path="/usr/local/Cellar" # it is slow to update and we can't pull specific minor versions.) setup_go () { echo "installing go" - curl -OL https://golang.org/dl/go${GO_VERSION}.${GO_ARCH}.tar.gz --output go${GO_VERSION}.${GO_ARCH}.tar.gz - echo "${GO_SHA} go${GO_VERSION}.${GO_ARCH}.tar.gz" | sha256sum --check + curl -L https://golang.org/dl/go${GO_VERSION}.${GO_ARCH}.tar.gz --output go${GO_VERSION}.${GO_ARCH}.tar.gz + echo "${GO_VERSION_SHA} go${GO_VERSION}.${GO_ARCH}.tar.gz" | shasum -a 256 --check sudo rm -rf ${path}/go sudo tar -C $path -xzf go${GO_VERSION}.${GO_ARCH}.tar.gz ln -sf ${path}/go/bin/go /usr/local/bin/go