mirror of
https://github.com/xtream1101/humblebundle-downloader.git
synced 2024-11-20 08:49:17 +01:00
34 lines
926 B
YAML
34 lines
926 B
YAML
image: python:3.10
|
|
|
|
stages:
|
|
- package
|
|
- release
|
|
|
|
|
|
pypi-package:
|
|
stage: package
|
|
only:
|
|
- tags
|
|
- update
|
|
script:
|
|
- 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:
|
|
stage: release
|
|
only:
|
|
- main
|
|
script:
|
|
- *write_permission
|
|
- 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
|