diff --git a/ci/build_dist.yml b/ci/build_dist.yml
index ec4a102bffeb9f86032fac4bf50b16e48a1fcddd..b0c1bcc43f612d6f32760e73cbd91e8b214b9f73 100644
--- a/ci/build_dist.yml
+++ b/ci/build_dist.yml
@@ -1,18 +1,10 @@
 build_dist:
   stage: build
   script:
-    - if [ $CI_COMMIT_REF_NAME = master ]; then
-       poetry version $(poetry version | cut -d" " -f2)+$(date +%s).${CI_COMMIT_SHORT_SHA} ;
-      elif [ x$CI_OMMIT_REF_NAME = x$CI_COMMIT_TAG ]; then
-       if ! [ "$(poetry version | cut -d" " -f2)" = $CI_COMMIT_REF_NAME ]; then
-        echo "Package version does not match tag. Aborting build of tag!" >/dev/fd/2 ;
-        exit 1 ;
-       fi ;
+    - if ! [ x$CI_COMMIT_REF_NAME = x$CI_COMMIT_TAG ]; then
+        poetry version $(poetry version | cut -d" " -f2)+$(date --date=${CI_COMMIT_TIMESTAMP} +%Y%m%d%H%M%S).${CI_COMMIT_SHORT_SHA} ;
       fi
     - tox -e build
   artifacts:
     paths:
       - dist/
-  only:
-    - master
-    - tags
diff --git a/ci/deploy_pypi.yml b/ci/deploy_pypi.yml
index 6b235ad05fe3eb2d70f706a93fedd91219cd6605..1d388e3564bdb57fd7b0e4fff2408c53fd919692 100644
--- a/ci/deploy_pypi.yml
+++ b/ci/deploy_pypi.yml
@@ -1,9 +1,17 @@
 deploy_pypi:
   stage: deploy
   script:
+    - if [ $CI_COMMIT_REF_NAME = master ]; then
+       poetry version $(poetry version | cut -d" " -f2)+$(date --date=${CI_COMMIT_TIMESTAMP} +%Y%m%d%H%M%S).${CI_COMMIT_SHORT_SHA} ;
+      elif [ x$CI_COMMIT_REF_NAME = x$CI_COMMIT_TAG ]; then
+       if ! [ "$(poetry version | cut -d" " -f2)" = $CI_COMMIT_REF_NAME ]; then
+        echo "Package version does not match tag. Aborting build of tag!" >/dev/fd/2 ;
+        exit 1 ;
+       fi ;
+      fi
     - if [ $CI_COMMIT_REF_NAME = master ]; then
        poetry publish -r gitlab ;
-      elif [ x$CI_OMMIT_REF_NAME = x$CI_COMMIT_TAG ]; then
+      elif [ x$CI_COMMIT_REF_NAME = x$CI_COMMIT_TAG ]; then
        poetry publish ;
       fi
   only: