From 58ac07b90838fc15b6cdcbc9a5e652a801e8b756 Mon Sep 17 00:00:00 2001
From: Yoann Schneider <yschneider@teklia.com>
Date: Thu, 1 Feb 2024 15:25:52 +0100
Subject: [PATCH] Publish on PyPi

---
 .gitlab-ci.yml | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index bbfc4ff..93144ac 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -55,3 +55,22 @@ bump-python-deps:
 
   script:
     - devops python-deps requirements.txt
+
+deploy-pypi:
+  stage: release
+  image: python:3.10
+
+  only:
+    - tags
+
+  variables:
+    TWINE_USERNAME: gitlab-ci-token
+    TWINE_PASSWORD: ${CI_JOB_TOKEN}
+    TWINE_REPOSITORY_URL: ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi
+
+  before_script:
+    - pip install twine
+
+  script:
+    - python setup.py sdist bdist_wheel
+    - twine upload --repository-url ${TWINE_REPOSITORY_URL} dist/*
-- 
GitLab