github.com/grafana/pyroscope@v1.18.0/tools/upgrade-go-version.sh (about) 1 #!/usr/bin/env bash 2 3 set -euo pipefail 4 5 if [ $# -ne 1 ]; then 6 echo "Usage: $0 <version>" 7 exit 1 8 fi 9 10 # update ci/cd versions 11 git ls-files .github/workflows | xargs sed -i 's/go-version:\([ \["]\+\)\([0-9\.\=<>]\+\)/go-version:\1'$1'/g' 12 13 # update goreleaser check 14 sed -i 's/go version go[0-9\.]\+/go version go'$1'/g' .goreleaser.yaml 15 16 # update .pyroscope.yaml 17 sed -i 's/ref: go[0-9\.]\+/ref: go'$1'/g' .pyroscope.yaml 18 19 # update update-examples image 20 sed -i 's/GO_VERSION=[0-9\.]\+/GO_VERSION='$1'/g' .pyroscope.yaml tools/update_examples.Dockerfile 21 22 # update all dockerfile versions, skips the elf tests from ebpf 23 DOCKER_FILES=$(git ls-files '**/Dockerfile*' | grep -v ebpf/symtab/elf/testdata/Dockerfile) 24 sed -i 's/golang:[0-9\.]\+/golang:'$1'/g' $DOCKER_FILES 25 git add -u $DOCKER_FILES 26 27 # add changes 28 git add -u .github/workflows .goreleaser.yaml .pyroscope.yaml tools/update_examples.Dockerfile 29 30 git commit -m "Update golang version to $1"