From 1b1b57db075666b4c31dd349da493e3404a5ba73 Mon Sep 17 00:00:00 2001 From: Mike Hendricks Date: Thu, 11 Aug 2022 19:59:53 -0700 Subject: [PATCH] Add PyPi Release action --- .github/workflows/python-release.yml | 37 ++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/python-release.yml diff --git a/.github/workflows/python-release.yml b/.github/workflows/python-release.yml new file mode 100644 index 0000000..b321e96 --- /dev/null +++ b/.github/workflows/python-release.yml @@ -0,0 +1,37 @@ +name: PyPi Release + +on: + release: + types: [created] + +jobs: + + build-and-publish: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: "3.x" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install --upgrade setuptools wheel twine + + - name: Build wheel + run: | + python setup.py build bdist_wheel + + - name: Publish to PyPI + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + twine upload --verbose dist/*