Test publish using poetry

This commit is contained in:
Eddy Hintze 2024-07-31 20:26:23 -04:00
parent 7369da336f
commit 177eaac3fc

View File

@ -1,36 +1,21 @@
image: python:3.7 image: python:3.10
stages: stages:
- test
- release
- package - package
- release
flake8:
stage: test
except:
- tags
script:
- pip install tox
- tox -e flake8
pytest:
stage: test
except:
- tags
script:
- pip install tox
- tox -e py37
pypi-package: pypi-package:
stage: package stage: package
only: only:
- tags - tags
- update
script: script:
- pip install twine - apt-get update -y && apt-get install -y curl
- rm -f dist/* - curl -sSL https://install.python-poetry.org | python3 -
- python setup.py sdist - export PATH="/root/.local/bin:$PATH"
- twine upload -u ${PYPI_USER} -p ${PYPI_PASS} dist/* - poetry build
- poetry publish
.write_permission: &write_permission | .write_permission: &write_permission |
git config --global user.email "gitlab-ci"; git config --global user.name "gitlab-ci" git config --global user.email "gitlab-ci"; git config --global user.name "gitlab-ci"
@ -43,6 +28,6 @@ tag:
- main - main
script: script:
- *write_permission - *write_permission
- export VERSION=$(echo $(python -c "import humblebundle_downloader._version as v; print(v.__version__)")) - 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 Build" - git tag -a $VERSION -m "Version created by gitlab-ci release"
- git push origin $VERSION - git push origin $VERSION