From e8adb96617269466eb4c131e72a3d0a8e5049d06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Thu, 7 Oct 2021 21:46:52 +0200 Subject: [PATCH] [CI] Sanitize version from branch name --- .circleci/config.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d28429dc4be9..d1761faa53fb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -209,9 +209,16 @@ jobs: - run: | cd /tmp/workspace/distribution-scripts - # How to brand it - export VERSION=${CIRCLE_BRANCH/release\//} - export VERSION=${VERSION//\//-}-dev + # The version is based on the branch name. + VERSION=$CIRCLE_BRANCH + + # We need to sanitize it because there are restrictions on some places + # where the version is use (Mac pkg names, snap branch). + VERSION=${VERSION/release\//} + VERSION=${VERSION//_/-} + VERSION=${VERSION//\//-}-dev + + export VERSION echo "export CRYSTAL_VERSION=$VERSION" >> build.env echo "export DOCKER_TAG=$VERSION" >> build.env