From bd3aa03b0e48ebe0c269a9f51b60b3dca357d68b Mon Sep 17 00:00:00 2001 From: JMante1 <40006518+JMante1@users.noreply.github.com> Date: Mon, 1 Nov 2021 17:04:23 -0600 Subject: [PATCH] Create python-publish.yml --- .github/python-publish.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/python-publish.yml diff --git a/.github/python-publish.yml b/.github/python-publish.yml new file mode 100644 index 0000000..56c76c2 --- /dev/null +++ b/.github/python-publish.yml @@ -0,0 +1,34 @@ +# This workflow will upload a Python Package using Twine when a release is created + +name: Upload Python Package + +on: + release: + types: [created] + +jobs: + deploy: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + - name: Update version + run: | + sed -i "s/version=.*,/version='${{ github.event.release.tag_name }}',/g" setup.py + - name: Build and publish + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + cat setup.py + python setup.py sdist bdist_wheel + twine upload dist/*