From 45dd5d067e6139286adbe218b31863e431047d65 Mon Sep 17 00:00:00 2001
From: Georg Krause <mail@georg-krause.net>
Date: Sat, 2 Apr 2022 11:23:39 +0200
Subject: [PATCH] Build release Pipeline

---
 .gitlab-ci.yml | 26 +++++++++++++++++++++++++-
 pyproject.toml |  2 +-
 2 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 3a21e94..e7f9f84 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,6 +1,8 @@
 stages:
   - lint
   - test
+  - package
+  - deploy
 
 lint:
   stage: lint
@@ -15,7 +17,29 @@ test:
       - PY_VER: ["3.7", "3.8", "3.9", "3.10"]
   image: $CI_REGISTRY/funkwhale/backend-test-docker:$PY_VER
   before_script: 
-    - pip install poetry
     - poetry install
   script:
     - poetry run python test/test.py
+
+package: 
+  stage: package
+  image: $CI_REGISTRY/funkwhale/backend-test-docker:3.10
+  before_script:
+    - poetry install
+  script:
+    - poetry build
+  artifacts:
+    paths:
+      - dist/*
+
+deploy:
+  image: $CI_REGISTRY/funkwhale/backend-test-docker:3.10
+  before_script:
+    - poetry install
+    - git pull --tags
+  script:
+    - poetry version $(git describe --tags --abbrev=0)
+    - poetry build
+    - poetry publish --username $PYPI_USERNAME --password $PYPI_TOKEN
+  only:
+    - tags
diff --git a/pyproject.toml b/pyproject.toml
index 2c5febd..4b1f371 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
 [tool.poetry]
 name = "requests-http-message-signatures"
-version = "0.3.0-dev3"
+version = "v0.2.0"
 description = "A request authentication plugin implementing IETF HTTP Message Signatures"
 readme = "README.md"
 homepage = "https://dev.funkwhale.audio/funkwhale/requests-http-message-signatures"
-- 
GitLab