diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index a1bd209d9a468123fafce0107e217475a20bfc2d..25a56c455623255e69193adfed236988f5a0a1c7 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -38,3 +38,19 @@ pages:
       when: always
     - if: $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH
       when: manual
+
+pypi:
+  needs: 
+    - job: "build"
+      artifacts: true
+  script:
+      - pip install -U twine
+      - twine upload -u "$TWINE_USERNAME" -p "$TWINE_PASSWORD" dist/*
+  rules:
+    - if: '$CI_COMMIT_TAG =~ /^v\d{4}\.\d{1,2}\.\d{1,2}$/'
+      # Always publish tagged commits matching CalVer
+      when: on_success
+    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
+      # Allow manually pushing to pypi
+      when: manual
+