diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5646424..5005d9c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,3 +27,35 @@ jobs: - name: Run tests run: make test + release: + name: Release + needs: test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: "3.10" + + - name: Install requirements + run: python -m pip install wheel + + - name: Build a distribution + run: python setup.py sdist bdist_wheel + + - name: Publish package to TestPyPI + uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.TEST_PYPI_API_TOKEN }} + repository_url: https://test.pypi.org/legacy/ + skip_existing: true + + - name: Publish package to PyPI + uses: pypa/gh-action-pypi-publish@master + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }}