Add deploy to PyPI stage in CI/CD
This commit is contained in:
parent
6af885f148
commit
5f491bf19e
1 changed files with 28 additions and 0 deletions
|
@ -4,6 +4,7 @@ stages:
|
|||
- build
|
||||
- linter
|
||||
- tests
|
||||
- deploy
|
||||
|
||||
variables:
|
||||
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
|
||||
|
@ -63,3 +64,30 @@ Pytest:
|
|||
coverage_report:
|
||||
coverage_format: cobertura
|
||||
path: coverage.xml
|
||||
|
||||
# Deployment
|
||||
Deploy2PyPI:
|
||||
stage: deploy
|
||||
cache: {}
|
||||
rules:
|
||||
- if: '$CI_COMMIT_TAG =~ /^(v|V)?(\d+)(\.\d+)+?$/ && $PYPI_TOKEN'
|
||||
variables:
|
||||
POETRY_PYPI_TOKEN_PYPI: $PYPI_TOKEN
|
||||
before_script:
|
||||
- python -m pip install poetry>=1.7
|
||||
script:
|
||||
- poetry publish --build
|
||||
environment:
|
||||
name: PyPI
|
||||
url: https://pypi.org/project/glicid-spawner/
|
||||
|
||||
Deploy2SWH:
|
||||
stage: deploy
|
||||
cache: {}
|
||||
rules:
|
||||
- if: '$CI_COMMIT_TAG =~ /^(v|V)?(\d+)(\.\d+)+?$/'
|
||||
script:
|
||||
- curl -X POST https://archive.softwareheritage.org/api/1/origin/save/git/url/${CI_PROJECT_URL}/
|
||||
environment:
|
||||
name: Software Heritage
|
||||
url: https://archive.softwareheritage.org/browse/origin/?origin_url=${CI_PROJECT_URL}
|
||||
|
|
Loading…
Add table
Reference in a new issue