From 4bc5ac2420acc130fe89f9c4ec16fd6bea023afb Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Thu, 4 Aug 2022 03:18:51 +0300 Subject: [PATCH] Add pre-release version to package and upload to TestPyPI Update version to form {current-version}-alpha.{unix-timestamp} in setup.py --- .github/workflows/publish.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 932fcc8c..69fbf35a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -36,8 +36,20 @@ jobs: twine check dist/* - name: Publish App to PyPI + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_API_KEY }} + run: | + twine upload dist/* + + - name: Publish App to Test PyPI env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_KEY }} run: | + sed -E -i "s/version='(.*)',/version=\1-alpha.$(date +%s)',/g" setup.py + rm -rf dist + python -m build + twine check dist/* twine upload -r testpypi dist/* \ No newline at end of file