File tree Expand file tree Collapse file tree 3 files changed +22
-2
lines changed
Expand file tree Collapse file tree 3 files changed +22
-2
lines changed Original file line number Diff line number Diff line change 1313 steps :
1414 - uses : actions/checkout@v5
1515
16+ - name : Set env
17+ run : echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
18+
1619 - run : |
1720 make build
1821
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ services:
1616 BUILDKITE_BUILD_ID : ~
1717 BUILDKITE_BUILD_NUMBER : ~
1818 BUILDKITE_JOB_ID : ~
19+ RELEASE_VERSION : ~
1920 RELEASE_CHANNEL : ~
2021 GO111MODULE : ~
2122 volumes :
Original file line number Diff line number Diff line change @@ -6,8 +6,23 @@ git fetch --tags --force
66PREV_TAG=` git describe --tags --abbrev=0`
77VERSION=" "
88
9+ echo " Previous tag is ${PREV_TAG} "
10+
11+ if [[ ${RELEASE_VERSION:- " " } != " " ]]; then
12+ if [[ ${RELEASE_VERSION} == " master" ]]; then
13+ VERSION=${PREV_TAG}
14+
15+ # if there are multiple revisions, append that revision number
16+ _REV_COUNT=$( git rev-list " ${PREV_TAG} " ..HEAD --count 2> /dev/null) || true
17+ echo " REV_COUNT is ${_REV_COUNT} "
18+ if [[ ! -z " ${_REV_COUNT:- } " ]]; then
19+ VERSION=" ${PREV_TAG} +internal.${_REV_COUNT} "
20+ fi
21+ else
22+ VERSION=" ${RELEASE_VERSION} "
23+ fi
924# when executing this script with a git tag defined by buildkite, we are releasing to production
10- if [[ ${BUILDKITE_TAG:- " " } != " " ]]; then
25+ elif [[ ${BUILDKITE_TAG:- " " } != " " ]]; then
1126 VERSION=" $BUILDKITE_TAG "
1227# when executing this script on the master/staging branch, we are releasing internal versions
1328elif [[ ${BUILDKITE_BRANCH:- } == " master" || ${BUILDKITE_BRANCH:- } == " staging" ]]; then
@@ -20,7 +35,8 @@ elif [[ ${BUILDKITE_BRANCH:-} == "master" || ${BUILDKITE_BRANCH:-} == "staging"
2035 fi
2136fi
2237
38+ echo " VERSION is ${VERSION} "
39+
2340# write the generated version back to VERSION file which will be used in generation
2441# of binaries
2542echo -n " __version__ = \" ${VERSION} \" " > ./blackfire_conprof/version.py
26-
You can’t perform that action at this time.
0 commit comments