Skip to content

Commit

Permalink
CI: Use universal publish manifest (#379)
Browse files Browse the repository at this point in the history
There is now a project called [build](https://pypa-build.readthedocs.io/en/stable/) which is dedicated to building Python package distributions regardless of the project backend (setuptools, poetry, hatch...).

The PyPA also publishes an official GH action for releasing to PyPI.

This PR combines both.
  • Loading branch information
ghisvail authored Feb 15, 2023
1 parent b5bf033 commit 43f7056
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,26 @@ name: publish

on:
release:
types:
- published
types: [ published ]

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: snok/install-poetry@v1
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Build distribution
run: pipx run build
- name: Publish to PyPI
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: make publish
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}

0 comments on commit 43f7056

Please sign in to comment.