From 8fe7046aa37d5b4442ab3d05589c105d17112204 Mon Sep 17 00:00:00 2001 From: James Sutton <1892175+zeryx@users.noreply.github.com> Date: Tue, 29 Jun 2021 14:51:59 -0700 Subject: [PATCH] updates to enable automatic deployment (#95) * updates to enable automatic deployment * fixed a typo * hopefully fixed broken release system * ensured that we have pypirc being templated correctly * added twine logic, should work * removing pypitest as it's not directly compatible with twine * commenting out all other work to verify deployment system * missed a $ * swapped out the hidden environment variable * release candidate --- .gitlab-ci.yml | 18 ++++++++++++++++++ setup.py | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b97ebf1..79d344d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,12 +4,30 @@ stages: - python37 - python38 - python39 + - deploy variables: PROJECT_NAME: algorithmia-python DOCKER_HOST: tcp://docker:2375/ DOCKER_DRIVER: overlay2 RUNNING_ON_BUILD_SERVER: "true" + TWINE_USERNAME: __token__ + CLIENT_VERSION: $CI_COMMIT_TAG + + +deploy: + stage: deploy + only: + - tags + image: python:3.7 + script: +# - export CLIENT_VERSION=$(git describe --abbrev=0 2>/dev/null || echo '') + - echo $CLIENT_VERSION + - python -m pip install --upgrade pip + - pip install wheel twine setuptools + - python setup.py sdist bdist_wheel + - python3 setup.py sdist bdist_wheel --universal + - twine upload -r pypi dist/* test: stage: test diff --git a/setup.py b/setup.py index 6756ab7..05b17d5 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ setup( name='algorithmia', - version='1.8.2', + version=os.environ.get('CLIENT_VERSION', '0.0.0'), description='Algorithmia Python Client', long_description='Algorithmia Python Client is a client library for accessing Algorithmia from python code. This library also gets bundled with any Python algorithms in Algorithmia.', url='http://github.com/algorithmiaio/algorithmia-python',