Skip to content
Snippets Groups Projects
Commit 215fccfc authored by Corné Lukken's avatar Corné Lukken
Browse files

Add publish job for sid

parent d055ce40
Branches
Tags
1 merge request!7Add publish job for sid
...@@ -2,8 +2,6 @@ default: ...@@ -2,8 +2,6 @@ default:
image: image:
name: $CI_REGISTRY_IMAGE/ci-build-runner:$CI_COMMIT_REF_SLUG name: $CI_REGISTRY_IMAGE/ci-build-runner:$CI_COMMIT_REF_SLUG
pull_policy: always pull_policy: always
before_script:
- python --version # For debugging
cache: cache:
paths: paths:
- .cache/pip - .cache/pip
...@@ -33,41 +31,37 @@ trigger_prepare: ...@@ -33,41 +31,37 @@ trigger_prepare:
strategy: depend strategy: depend
include: .prepare.gitlab-ci.yml include: .prepare.gitlab-ci.yml
.python_before:
before_script:
- python --version # For debugging
run_black: run_black:
stage: lint stage: lint
extends: .python_before
script: script:
- tox -e black - tox -e black
allow_failure: true allow_failure: true
run_flake8: run_flake8:
stage: lint stage: lint
extends: .python_before
script: script:
- tox -e pep8 - tox -e pep8
allow_failure: true allow_failure: true
run_pylint: run_pylint:
stage: lint stage: lint
extends: .python_before
script: script:
- tox -e pylint - tox -e pylint
allow_failure: true allow_failure: true
sast: sast:
variables: variables:
SAST_EXCLUDED_ANALYZERS: brakeman, flawfinder, kubesec, nodejs-scan, phpcs-security-audit, SAST_EXCLUDED_ANALYZERS: brakeman, flawfinder, kubesec, nodejs-scan, phpcs-security-audit,
pmd-apex, security-code-scan, sobelow, spotbugs pmd-apex, security-code-scan, sobelow, spotbugs
stage: test stage: test
dependency_scanning:
# override default before_script, job won't have Python available
before_script:
- uname
secret_detection:
# override default before_script, job won't have Python available
before_script:
- uname
# Basic setup for all Python versions for which we don't have a base image # Basic setup for all Python versions for which we don't have a base image
.run_unit_test_version_base: .run_unit_test_version_base:
before_script: before_script:
...@@ -89,6 +83,7 @@ run_unit_tests: ...@@ -89,6 +83,7 @@ run_unit_tests:
# Run code coverage on the base image thus also performing unit tests # Run code coverage on the base image thus also performing unit tests
run_unit_tests_coverage: run_unit_tests_coverage:
stage: test stage: test
extends: .python_before
script: script:
- tox -e coverage - tox -e coverage
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/' coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
...@@ -102,6 +97,7 @@ run_unit_tests_coverage: ...@@ -102,6 +97,7 @@ run_unit_tests_coverage:
package_files: package_files:
stage: package stage: package
extends: .python_before
artifacts: artifacts:
expire_in: 1w expire_in: 1w
paths: paths:
...@@ -111,6 +107,7 @@ package_files: ...@@ -111,6 +107,7 @@ package_files:
package_docs: package_docs:
stage: package stage: package
extends: .python_before
artifacts: artifacts:
expire_in: 1w expire_in: 1w
paths: paths:
...@@ -118,9 +115,20 @@ package_docs: ...@@ -118,9 +115,20 @@ package_docs:
script: script:
- tox -e docs - tox -e docs
publish_on_pypi:
stage: publish
environment: pypi
needs:
- package_files
when: manual
rules:
- if: '$CI_COMMIT_TAG && $CI_COMMIT_REF_PROTECTED == "true"'
script:
- echo "run twine for pypi"
- |
TWINE_PASSWORD="${PYPI_TOKEN}" \
TWINE_USERNAME="__token__" \
python -m twine upload dist/*
publish_on_gitlab: publish_on_gitlab:
stage: publish stage: publish
...@@ -137,7 +145,6 @@ publish_on_gitlab: ...@@ -137,7 +145,6 @@ publish_on_gitlab:
python -m twine upload \ python -m twine upload \
--repository-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi dist/* --repository-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi dist/*
publish_to_readthedocs: publish_to_readthedocs:
stage: publish stage: publish
allow_failure: true allow_failure: true
......
...@@ -7,7 +7,7 @@ url = https://git.astron.nl/lofar2.0/sid ...@@ -7,7 +7,7 @@ url = https://git.astron.nl/lofar2.0/sid
license = Apache License 2.0 license = Apache License 2.0
classifiers = classifiers =
Development Status :: 3 - Alpha Development Status :: 3 - Alpha
Environment :: Web Environment Environment :: Plugins
Intended Audience :: Developers Intended Audience :: Developers
Intended Audience :: Science/Research Intended Audience :: Science/Research
License :: OSI Approved :: Apache Software License License :: OSI Approved :: Apache Software License
...@@ -20,10 +20,10 @@ classifiers = ...@@ -20,10 +20,10 @@ classifiers =
Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11 Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12 Programming Language :: Python :: 3.12
Topic :: Internet :: WWW/HTTP Topic :: Software Development :: Libraries
Topic :: Internet :: WWW/HTTP :: Dynamic Content
Topic :: Scientific/Engineering Topic :: Scientific/Engineering
Topic :: Scientific/Engineering :: Astronomy Topic :: Scientific/Engineering :: Astronomy
Topic :: Scientific/Engineering :: Interface Engine/Protocol Translator
[options] [options]
include_package_data = true include_package_data = true
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment