From 6e4fa0afbe754f052078361c9fb700c83af16f72 Mon Sep 17 00:00:00 2001 From: Navaneesh Kumar Date: Fri, 31 Dec 2021 18:18:46 -0800 Subject: [PATCH] Create publish-test.yml --- .github/workflows/publish-test.yml | 41 ++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/publish-test.yml diff --git a/.github/workflows/publish-test.yml b/.github/workflows/publish-test.yml new file mode 100644 index 0000000..378e22c --- /dev/null +++ b/.github/workflows/publish-test.yml @@ -0,0 +1,41 @@ +name: Upload Python Package to test.pypi.org + +on: + release: + types: [published] + +jobs: + deploy: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.8" + + - name: Install dependencies + run: | + curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python - + $HOME/.poetry/bin/poetry install + + - name: Build package + run: $HOME/.poetry/bin/poetry build + + - name: Setup Test PyPI in poetry + env: + TEST_PYPI_API_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }} + run: | + touch $HOME/.pypirc + echo "[testpypi]" >> $HOME/.pypirc + echo " username = __token__" >> $HOME/.pypirc + echo " password = $TEST_PYPI_API_TOKEN" >> $HOME/.pypirc + $HOME/.poetry/bin/poetry config repositories.test-pypi https://test.pypi.org/legacy/ + $HOME/.poetry/bin/poetry config pypi-token.test-pypi "$TEST_PYPI_API_TOKEN" + + - name: Publish package to test.pypi.org + run: | + $HOME/.poetry/bin/poetry publish -r test-pypi +