From e029e3fe0fac3728539dea61eef56ed4f2ffbb36 Mon Sep 17 00:00:00 2001 From: Rudolf Offereins Date: Wed, 21 Apr 2021 20:08:23 +0000 Subject: [PATCH 1/2] Add workflow for test pypi --- .github/workflows/publish-to-test-pypi.yml | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/publish-to-test-pypi.yml diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml new file mode 100644 index 0000000..6f39585 --- /dev/null +++ b/.github/workflows/publish-to-test-pypi.yml @@ -0,0 +1,35 @@ +name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI +on: push +jobs: + build-n-publish: + name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@master + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + - name: Install pypa/build + run: >- + python -m + pip install + build + --user + - name: Build a binary wheel and a source tarball + run: >- + python -m + build + --sdist + --wheel + --outdir dist/ + - name: Publish distribution 📦 to Test PyPI + uses: pypa/gh-action-pypi-publish@master + with: + password: ${{ secrets.TEST_PYPI_API_TOKEN }} + repository_url: https://test.pypi.org/legacy/ + # - name: Publish distribution 📦 to PyPI + # if: startsWith(github.ref, 'refs/tags') + # uses: pypa/gh-action-pypi-publish@master + # with: + # password: ${{ secrets.PYPI_API_TOKEN }} \ No newline at end of file From a4def42ced6420e6b5c52cd2995fbf41403bcfec Mon Sep 17 00:00:00 2001 From: Rudolf Offereins Date: Wed, 21 Apr 2021 20:15:49 +0000 Subject: [PATCH 2/2] Skip existing packages --- .github/workflows/publish-to-test-pypi.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index 6f39585..12b6c50 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -28,6 +28,7 @@ jobs: with: password: ${{ secrets.TEST_PYPI_API_TOKEN }} repository_url: https://test.pypi.org/legacy/ + skip_existing: true # - name: Publish distribution 📦 to PyPI # if: startsWith(github.ref, 'refs/tags') # uses: pypa/gh-action-pypi-publish@master