Skip to content
Snippets Groups Projects
Commit 8cff21a5 authored by Max Drexler's avatar Max Drexler
Browse files

fix deploy rules

parent 12ba4873
No related merge requests found
......@@ -45,19 +45,40 @@ build-req-image:
changes:
- .meta/Dockerfile
.on-file-change:
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
changes:
paths:
- grib_processor/**/*
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
when: always
- if: $CI_COMMIT_TAG
when: always
.on-new-version:
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
when: never
- if: $CI_COMMIT_TAG =~ /\d+\.\d+\.\d+$/
when: always
test::lint:
stage: test
extends: .on-file-change
script:
- python -m ruff format --check --diff --target-version py38
- python -m ruff check --diff --target-version py38
test::static-analysis:
stage: test
extends: .on-file-change
script:
- python -m mypy grib_processor/
test::unit:
stage: test
extends: .on-file-change
script:
- python -m coverage run -m pytest
- python -m coverage report
......@@ -74,9 +95,7 @@ test::unit:
deploy::build:
stage: deploy
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_COMMIT_TAG =~ /\d+\.\d+\.\d+$/
extends: .on-new-version
before_script:
pip install build
script:
......@@ -89,10 +108,8 @@ deploy::build:
deploy::package::release:
stage: deploy
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_COMMIT_TAG =~ /\d+\.\d+\.\d+$/
extends: .on-new-version
before_script:
pip install twine
script:
- TWINE_PASSWORD=${CI_JOB_TOKEN} TWINE_USERNAME=gitlab-ci-token python -m twine upload --repository-url ${PACKAGE_REGISTRY_URL} dist/*
- TWINE_PASSWORD=${CI_JOB_TOKEN} TWINE_USERNAME=gitlab-ci-token python -m twine upload --repository-url ${PACKAGE_REGISTRY_URL} ./dist/*
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment