From 3c4b03fbfdd88d3ef13aff15e3636a8abfe8c293 Mon Sep 17 00:00:00 2001
From: Geoffrey Arthaud <geoffrey.arthaud@developpement-durable.gouv.fr>
Date: Tue, 17 Oct 2023 10:47:55 +0200
Subject: [PATCH] CI - Deploy to prod

---
 .gitlab-ci.yml    | 23 ++++++++++++++++++++++-
 README.md         |  5 +++++
 package-lock.json |  4 ++--
 package.json      |  2 +-
 4 files changed, 30 insertions(+), 4 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 07ff3ee..c73fbe0 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -30,6 +30,8 @@ build_and_deploy_gitlab:
     paths:
       - version.txt
     expire_in: "2 days"
+  rules:
+    - if: $CI_COMMIT_BRANCH == "main"
 
 deploy_exemple_site:
   image: python:3.11.6-bookworm
@@ -43,4 +45,23 @@ deploy_exemple_site:
     - pipenv run mkdocs build --strict --verbose -d ../public
   artifacts:
     paths:
-      - public
\ No newline at end of file
+      - public
+  rules:
+    - if: $CI_COMMIT_BRANCH == "main"
+
+deploy_pypi:
+  image: nikolaik/python-nodejs:python3.11-nodejs20
+  stage: deploy_dev
+  script:
+    - pip install pipenv
+    - pipenv install
+    - npm ci --cache .npm --prefer-offline
+    - pipenv run npm run build:prod
+    - pipenv run python -m build
+    - TWINE_PASSWORD=${PYPI_PASSWORD} TWINE_USERNAME=${PYPI_USER} pipenv run python -m twine upload --skip-existing dist/*
+  cache:
+    paths:
+      - .npm/
+      - .pipenv/
+  rules:
+    - if: $CI_COMMIT_TAG
\ No newline at end of file
diff --git a/README.md b/README.md
index f75d12e..6ccb714 100644
--- a/README.md
+++ b/README.md
@@ -121,6 +121,11 @@ dictionnaire avec des clés `name` et `url`.
 
 ## Notes de version
 
+### Version 0.6.1 (DSFR 1.10.1)
+
+* Correction de bug de paramètre de conf
+* Changement de nom du paramètre `button_edit_label`
+
 ### Version 0.6.0 (DSFR 1.10.1)
 
 * Allègement du thème
diff --git a/package-lock.json b/package-lock.json
index 0a488d9..275dc24 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
 {
   "name": "mkdocs-dsfr",
-  "version": "0.5.3",
+  "version": "0.6.1",
   "lockfileVersion": 2,
   "requires": true,
   "packages": {
     "": {
       "name": "mkdocs-dsfr",
-      "version": "0.5.3",
+      "version": "0.6.1",
       "license": "MIT",
       "dependencies": {
         "@gouvfr/dsfr": "1.10.1"
diff --git a/package.json b/package.json
index 091612e..50a9d5c 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "mkdocs-dsfr",
-  "version": "0.6.1-dev",
+  "version": "0.6.1",
   "description": "Mkdocs theme for DSFR",
   "main": "index.js",
   "directories": {
-- 
GitLab