From 69ead6387deba417eb3e6a75de40c9dc322a66d2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Guillaume=20Perr=C3=A9al?= <guillaume.perreal@irstea.fr>
Date: Fri, 19 Feb 2021 09:15:14 +0100
Subject: [PATCH] ci: ajoute un job npm:publish pour les tags.

---
 .gitlab-ci.yml | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index ced23cb..a069466 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -52,10 +52,11 @@ test:compile-generated:
 npm:publish:
   extends: .nodejs
   stage: publish
-  only:
-    refs:
-      - tags
+  rules:
+    - if: '$CI_COMMIT_TAG && $CI_COMMIT_REF_PROTECTED == "true"'
   before_script:
+    - npm install -g npm
     - npm config set '//registry.npmjs.org/:_authToken' "$NPM_AUTH_TOKEN"
   script:
+    - npm version --no-git-tag-version "$CI_COMMIT_TAG"
     - npm publish --access=public .
-- 
GitLab