gitlab-ci: Publish to pypi.org on tag

.gitlab-ci.yml:
Add a publish stage, that uses `poetry publish` on a secure runner to
push a release to pypi.org upon tagging. For this we make use of an
access token configured for the project via the environment variable
`POETRY_PYPI_TOKEN_PYPI`.
This commit is contained in:
David Runge 2021-08-07 21:47:41 +02:00
parent d9fd8b3656
commit 639854563d
No known key found for this signature in database
GPG Key ID: 7258734B41C31549
1 changed files with 12 additions and 0 deletions

View File

@ -5,6 +5,7 @@ image: archlinux:latest
stages:
- check
- test
- publish
linter:
before_script:
@ -26,3 +27,14 @@ system_test:
script:
- pytest -vv tests/ -m "not integration"
stage: test
pypi_publish:
before_script:
- pacman --noconfirm -Syu --needed python-poetry
rules:
- if: '$POETRY_PYPI_TOKEN_PYPI && $CI_COMMIT_TAG'
script:
- poetry publish --build
stage: publish
tags:
- secure