From 651e4e38f65811a4886ec41d2383c5f0f9bcefa1 Mon Sep 17 00:00:00 2001 From: vigneshk-tw Date: Tue, 22 Oct 2024 16:09:15 +0530 Subject: [PATCH] adds if case to publish either to pypi or testpypi --- .github/workflows/publish.yml | 9 ++++++--- setup.py | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index cf691a9..5fbec6e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -2,7 +2,6 @@ name: Publish on: release: types: [published] - push: jobs: publish: @@ -35,6 +34,10 @@ jobs: - name: Publish to PyPi env: TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_APIKEY }} - run: twine upload --repository-url https://test.pypi.org/legacy/ dist/* --verbose + run: | + if [[ "${{ github.event.release.name }}" == *"alpha"* || "${{ github.event.release.name }}" == *"beta"* ]]; then + TWINE_PASSWORD: ${{ secrets.PYPI_APIKEY }} twine upload --repository-url https://test.pypi.org/legacy/ dist/* --verbose + else + TWINE_PASSWORD: ${{ secrets.PYPI_APIKEY }} twine upload dist/* --verbose + fi working-directory: xero-python diff --git a/setup.py b/setup.py index 2475ed7..aecde58 100644 --- a/setup.py +++ b/setup.py @@ -48,5 +48,5 @@ def read_file(filename): keywords="xero python sdk API oAuth", name="xero_python", packages=find_packages(include=["xero_python", "xero_python.*"]), - version="6.3.0-alpha.7", + version="6.3.0-alpha.8", )