From 400c8158ab8dfc9e99a1d8bcd135938f9529e019 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Tue, 1 Aug 2023 16:06:31 -0700 Subject: [PATCH] Update config.yml --- .circleci/config.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 481294afe5..31995657d0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -30,19 +30,24 @@ jobs: working_directory: ~/project environment: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: $PYPI_API_TOKEN PYPI_API_TOKEN: $PYPI_API_TOKEN # Use the environment variable in the job steps: - checkout # Check if setup.py is modified and publish to PyPI - run: - name: Check setup.py modification + name: PyPI publish command: | if [ -n "$(git diff --name-only $CIRCLE_SHA1^..$CIRCLE_SHA1 | grep 'setup.py')" ]; then - echo "Creating a PyPI token file..." + echo "setup.py modified" echo -e "[pypi]\nusername = __token__\npassword = $PYPI_API_TOKEN" > ~/.pypirc - python setup.py sdist - python -m pip install --upgrade twine + python -m pip install --upgrade pip + pip install twine + pip install wheel + pip install --upgrade setuptools + python setup.py sdist bdist_wheel twine upload dist/* else echo "No changes to setup.py. Skipping PyPI publish."