From 972c0ddf4ee06beaedb9aa37efafeec1fbdb531e Mon Sep 17 00:00:00 2001 From: Sean Vig Date: Sat, 12 Mar 2022 08:59:41 -0500 Subject: [PATCH] Add github action to automate creating PyPI packages --- .github/workflows/release.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..06aeb4f --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,33 @@ +name: Publish to PyPI +on: + push: + branches-ignore: ['*'] + tags: ['*'] + release: + types: [published] +jobs: + build-source: + name: Push source build + runs-on: ubuntu-latest + env: + python-version: "3.10" + steps: + - name: Checkout repo + uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: ${{ env.python-version }} + - name: Install dependencies + run: | + pip install --upgrade pip setuptools wheel + - name: Build source + run: | + python setup.py bdist_wheel + python setup.py sdist + - name: Publish package to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + if: github.event_name == 'release' + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }}