Updated CI/CD pipeline - now using repo tokens to push new releases to pypi

This commit is contained in:
Fabio Manganiello 2022-03-01 12:50:13 +01:00
parent c0039c3f87
commit 19a1e9c626
Signed by: blacklight
GPG key ID: D90FBA7F76362774

View file

@ -56,11 +56,17 @@ upload-pip-package:
only: only:
- tags - tags
script: script:
# Update the CI/CD configuration
- cd ~/platypush-ci-cd
- git pull
- cd -
# Build the package
- rm -rf build dist *.egg-info - rm -rf build dist *.egg-info
- export VERSION=$(grep -e '^\s*__version__\s*=' platypush/__init__.py | sed -r -e 's/^\s*__version__\s*=\s*.(.+?).\s*$/\1/') - export VERSION=$(grep -e '^\s*__version__\s*=' platypush/__init__.py | sed -r -e 's/^\s*__version__\s*=\s*.(.+?).\s*$/\1/')
- source ~/.credentials/pypi.env - source ~/.credentials/pypi.env
- python setup.py sdist bdist_wheel - python setup.py sdist bdist_wheel
# Upload to PyPI # Upload to PyPI
- twine upload ./dist/platypush-${VERSION}.tar.gz - twine upload --repository platypush ./dist/platypush-${VERSION}.tar.gz
# Upload to the local package repository # Upload to the local package repository
- TWINE_PASSWORD=$LOCAL_TWINE_PASSWORD TWINE_USERNAME=$LOCAL_TWINE_USERNAME twine upload --repository-url https://git.platypush.tech/api/v4/projects/3/packages/pypi dist/platypush-${VERSION}.tar.gz - TWINE_USERNAME=$LOCAL_TWINE_USERNAME TWINE_PASSWORD=$LOCAL_TWINE_PASSWORD twine upload --repository-url https://git.platypush.tech/api/v4/projects/3/packages/pypi dist/platypush-${VERSION}.tar.gz