]> kaliko git repositories - python-musicpd.git/blobdiff - .gitlab-ci.yml
ci: s/only/changes/
[python-musicpd.git] / .gitlab-ci.yml
index adcc708c09500ac2d9ef378b106f1bcf3f143ade..4d7f68d6de1961f3c3e95c296f00a78c3dc6539a 100644 (file)
@@ -25,8 +25,11 @@ stages:
     - source venv/bin/activate
     - pip install pytest-cov
     - py.test -q --cov=musicpd test.py
-  only:
-    - pushes
+  rules:
+    - changes:
+      - musicpd.py
+      - test.py
+    - if: $MUSICPD_TEST
 
 test-py3.11:
   extends:
@@ -68,9 +71,14 @@ test-py3.6:
 
 build:
   stage: build
+  extends:
+    - .cache_python
   script:
+    - python -m venv venv
+    - source venv/bin/activate
+    - pip install build
     # packaging test
-    - python setup.py bdist_wheel sdist
+    - python3 -m build -s -w
     - pip install dist/*.whl
     - pip install twine
     - twine check dist/*
@@ -80,21 +88,26 @@ build:
       - dist/*.whl
       - dist/*.tar.gz
       - dist/*.zip
-  only:
-    - pushes
+  rules:
+    - if: $CI_PIPELINE_SOURCE == "push"
 
 tag_release:
   stage: build
+  extends:
+    - .cache_python
   script:
-    - python setup.py bdist_wheel sdist
+    - python -m venv venv
+    - source venv/bin/activate
+    - pip install build
+    - python3 -m build -s -w
   artifacts:
     paths:
       - dist/*.whl
       - dist/*.tar.gz
       - dist/*.zip
     name: "$CI_PROJECT_NAME-$CI_COMMIT_TAG"
-  only:
-    - tags
+  rules:
+    - if: $CI_COMMIT_TAG
 
 pages:
   stage: build
@@ -104,5 +117,5 @@ pages:
   artifacts:
     paths:
       - public
-  only:
-    - master
+  rules:
+    - if: $CI_COMMIT_BRANCH == "master"