diff --git a/.github/workflows/pypi-package.yml b/.github/workflows/pypi-package.yml new file mode 100644 index 0000000..2b8f8aa --- /dev/null +++ b/.github/workflows/pypi-package.yml @@ -0,0 +1,45 @@ +name: Build & maybe upload PyPI package + +on: + push: + pull_request: + release: + types: + - published + workflow_dispatch: + +permissions: + contents: read + +jobs: + # Always build & lint package. + build-package: + name: Build & verify package + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - uses: hynek/build-and-inspect-python-package@v1 + + # Upload to real PyPI on GitHub Releases. + release-pypi: + name: Publish to PyPI + environment: release-pypi + # Only run for published releases. + if: github.repository_owner == 'python' && github.event.action == 'published' + runs-on: ubuntu-latest + needs: build-package + + permissions: + id-token: write + + steps: + - name: Download packages built by build-and-inspect-python-package + uses: actions/download-artifact@v3 + with: + name: Packages + path: dist + + - name: Upload package to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index c184a9c..0b2fbd6 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -1,4 +1,5 @@ -# How to release +How to release +-------------- - Update CHANGELOG.rst - bump version (YYYY.MM) in pyproject.toml @@ -13,7 +14,8 @@ - push the tag (``git push --tags``) -# Makefile usage +Makefile usage +-------------- This project includes a simple Makefile for syncing changes to the theme with the main CPython repository. Run ``make help`` for details on available rules.