mirror of
https://github.com/NewFuture/DDNS.git
synced 2022-04-19 20:24:44 +00:00
fix(pypi): get ci env
This commit is contained in:
@@ -36,6 +36,7 @@ deploy:
|
||||
- provider: pypi
|
||||
user: newfuture
|
||||
password: "${PYPI_PWD}"
|
||||
skip_cleanup: false
|
||||
distributions: "sdist bdist_wheel" # Your distributions here
|
||||
on:
|
||||
tags: true
|
||||
|
||||
@@ -24,12 +24,12 @@ with open(path.join(here, 'README.md'), encoding='utf-8') as f:
|
||||
long_description = f.read()
|
||||
|
||||
# Get version from environment vars
|
||||
if hasattr(environ,'TRAVIS_TAG'):
|
||||
version = environ['TRAVIS_TAG'] # `TRAVIS_TAG` from Travis
|
||||
elif hasattr(environ,'BUILD_SOURCEBRANCHNAME'):
|
||||
version = environ['BUILD_SOURCEBRANCHNAME'] # `BUILD_SOURCEBRANCHNAME` from azure pipelines
|
||||
if 'TRAVIS_TAG' in environ:
|
||||
version = environ['TRAVIS_TAG'] # `TRAVIS_TAG` from Travis
|
||||
elif 'BUILD_SOURCEBRANCHNAME' in environ:
|
||||
version = environ['BUILD_SOURCEBRANCHNAME'] # from azure pipelines
|
||||
else:
|
||||
raise Exception("This setup script should be run in CI/CD environment (TravisCI or AzurePipelines)")
|
||||
raise Exception("setup.py should be run in CI (Travis or AzurePipelines)")
|
||||
version = version.strip('v').strip('V')
|
||||
|
||||
# Arguments marked as "Required" below must be included for upload to PyPI.
|
||||
|
||||
Reference in New Issue
Block a user