Skip to content

Commit 7b1b1d8

Browse files
committed
[python-conprof] fix github staging pipeline
1 parent 036a77b commit 7b1b1d8

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

.github/workflows/release_staging.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ jobs:
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

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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:

scripts/update-version.sh

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,23 @@ git fetch --tags --force
66
PREV_TAG=`git describe --tags --abbrev=0`
77
VERSION=""
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
1328
elif [[ ${BUILDKITE_BRANCH:-} == "master" || ${BUILDKITE_BRANCH:-} == "staging" ]]; then
@@ -20,7 +35,8 @@ elif [[ ${BUILDKITE_BRANCH:-} == "master" || ${BUILDKITE_BRANCH:-} == "staging"
2035
fi
2136
fi
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
2542
echo -n "__version__ = \"${VERSION}\"" > ./blackfire_conprof/version.py
26-

0 commit comments

Comments
 (0)