From 19667f90df1943d70780e05fd2c6bc674cba6660 Mon Sep 17 00:00:00 2001 From: Bernard Knueven Date: Mon, 7 Jun 2021 13:41:11 -0600 Subject: [PATCH] adding GHA for publishing to PyPI and TestPyPI --- .github/workflows/publish-to-test-pypi.yml | 34 ++++++++++++++++++++++ 1 file changed, 34 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 00000000..1a3eaf8d --- /dev/null +++ b/.github/workflows/publish-to-test-pypi.yml @@ -0,0 +1,34 @@ +name: Publish Python distributions to PyPI and TestPyPI + +on: + push: + tags: + - '*' + +jobs: + build-n-publish: + name: Build and publish Python distributions to PyPI and TestPyPI + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@main + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + - name: Install gridx-egret + run: | + python -m pip install --user --upgrade setuptools wheel + - name: Build a binary wheel and a source tarball + run: | + python3 setup.py sdist bdist_wheel + - name: Publish distribution to Test PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.test_pypi_password }} + 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@release/v1 + with: + password: ${{ secrets.pypi_password }}