diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..8c6e30f1 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,32 @@ +# For more information, see the "Release a new version" notes in pyproject.toml. + +name: Upload Python Package + +on: + release: + types: [published] + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + cache: pip + cache-dependency-path: pyproject.toml + - name: Install dependencies + run: | + python -m pip install --upgrade build + - name: Build + run: | + python -m build + - name: Publish distribution 📦 to PyPI + if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release' + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/pyproject.toml b/pyproject.toml index b7e6ecad..f69c39c4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,7 +16,14 @@ # - check the CI status: # https://github.com/python/pyperformance/actions # -# Release a new version: +# Release a new version with GitHub (preferred): +# +# - go to the GitHub release tab: https://github.com/python/pyperformance/releases +# - click "Draft a new release" and fill the contents +# - finally click the "Publish release" button! Done! +# - monitor the publish status: https://github.com/python/pyperformance/actions/workflows/publish.yml +# +# Release a new version manually: # # - git tag VERSION # - git push --tags