humblebundle-downloader/.gitlab-ci.yml

33 lines
913 B
YAML
Raw Normal View History

2024-08-01 02:26:23 +02:00
image: python:3.10
stages:
2020-01-19 16:00:40 +01:00
- package
2024-08-01 02:26:23 +02:00
- release
2020-01-19 16:00:40 +01:00
pypi-package:
stage: package
only:
2020-01-19 16:00:40 +01:00
- tags
script:
2024-08-01 02:26:23 +02:00
- apt-get update -y && apt-get install -y curl
- curl -sSL https://install.python-poetry.org | python3 -
- export PATH="/root/.local/bin:$PATH"
- poetry build
- poetry publish
.write_permission: &write_permission |
git config --global user.email "gitlab-ci"; git config --global user.name "gitlab-ci"
url_host=`git remote get-url origin | sed -e "s/https:\/\/gitlab-ci-token:.*@//g"`
git remote set-url origin "https://gitlab-ci-token:${CI_TAG_UPLOAD_TOKEN}@${url_host}"
tag:
2020-01-19 16:00:40 +01:00
stage: release
only:
- main
script:
- *write_permission
2024-08-01 02:26:23 +02:00
- export VERSION=$(echo $(python -c "import importlib.metadata as v; print(v.version('humblebundle-downloader'))"))
- git tag -a $VERSION -m "Version created by gitlab-ci release"
- git push origin $VERSION