From 175d443788fe1ee3c666d659467b9c0621e8a555 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Fri, 8 Oct 2021 18:07:44 +0200 Subject: [PATCH] [CI] Sanitize version from branch name (#11294) --- .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