From b05228a423f1f310ceaa369d903ffb6066b77b8b Mon Sep 17 00:00:00 2001
From: Moul <moul@moul.re>
Date: Sat, 25 Apr 2020 14:17:52 +0200
Subject: [PATCH] [CI] Change only/except to rules

- Will be removed from GitLab v13.0
- https://docs.gitlab.com/ee/ci/yaml/#rules
---
 .gitlab-ci.yml | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 0b2b04f6..07b93811 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -11,14 +11,14 @@ variables:
 image: $DOCKER_IMAGE/$PYTHON_VERSION:latest
 
 .code_changes:
-  only:
-    changes:
+  rules:
+    - changes:
       - silkaj/*.py
       - tests/*.py
 
 .changes:
-  only:
-    changes:
+  rules:
+    - changes:
       - silkaj/*.py
       - tests/*.py
       - .gitlab-ci.yml
@@ -78,23 +78,26 @@ tests-3.8:
 
 pypi_test:
   stage: publish
-  only: [tags]
-  when: manual
+  rules:
+    - if: $CI_COMMIT_TAG
+      when: manual
   script:
     - poetry config repositories.pypi_test https://test.pypi.org/legacy/
     - poetry publish --build --username $PYPI_TEST_LOGIN --password $PYPI_TEST_PASSWORD --repository pypi_test
 
 pypi:
   stage: publish
-  only: [tags]
-  when: manual
+  rules:
+    - if: $CI_COMMIT_TAG
+      when: manual
   script:
     - poetry publish --build --username $PYPI_LOGIN --password $PYPI_PASSWORD
 
 pages:
   extends: .changes
   needs: [tests-3.7-coverage]
-  only: [dev]
+  rules:
+    - if: $CI_COMMIT_BRANCH == "dev"
   stage: coverage
   script: mv cov_html/ public/
   artifacts:
-- 
GitLab