diff --git a/.github/workflows/publish-to-pypi.yaml b/.github/workflows/publish-to-pypi.yaml new file mode 100644 index 0000000..c4d5d6d --- /dev/null +++ b/.github/workflows/publish-to-pypi.yaml @@ -0,0 +1,30 @@ +name: Publish Python Package to PyPI + +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.10' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + - name: Create .pypirc file + env: + PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + echo "[pypi]" >> ~/.pypirc + echo "username = __token__" >> ~/.pypirc + echo "password = $PYPI_PASSWORD" >> ~/.pypirc + - name: Build and publish + run: | + python setup.py sdist bdist_wheel + twine upload dist/* \ No newline at end of file