From c3c20d79f1ee884f2063b5a7ad14416afcf08cc8 Mon Sep 17 00:00:00 2001
From: Bryan Brancotte <bryan.brancotte@pasteur.fr>
Date: Wed, 7 Feb 2024 14:28:31 +0000
Subject: [PATCH] default when no tag provided

---
 .gitlab-ci.yml | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index a134521..562bd3b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -2,8 +2,6 @@ upload:
   stage: deploy
   needs: []
   image: python:3.11
-  rules:
-    - if: $CI_COMMIT_TAG
   variables:
     PRIVATE_REGISTRY_API_URL: "${PRIVATE_REGISTRY_API_URL}"
     TWINE_PASSWORD: "${PRIVATE_REGISTRY_TOKEN_PASSWORD}"
@@ -11,6 +9,10 @@ upload:
   script:
     - pip install "setuptools>=62.6" twine
     - echo "Tag name used ${CI_COMMIT_TAG}"
+    - >
+      if [[ -z "$CI_COMMIT_TAG" ]]; then
+        CI_COMMIT_TAG="v0.0.1a"
+      fi
     - sed -i "s/v0.0.1-dev/$CI_COMMIT_TAG/g" src/__init__.py
     - python -m build
     - python -m twine upload --verbose --repository-url ${PRIVATE_REGISTRY_API_URL} dist/*
-- 
GitLab