From 7186a3306d8d6d2a0716d1e272b83e3c939d7f47 Mon Sep 17 00:00:00 2001 From: grouazel Date: Mon, 12 Jun 2023 10:17:04 +0200 Subject: [PATCH] add a worfklow to publish to pypi on release --- .github/workflows/publish.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..76601129 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,32 @@ +name: Upload package to PyPI + +on: + release: + types: [created] + +jobs: + publish: + name: Publish to PyPI + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip build twine + - name: Build + run: | + python -m build --sdist --wheel . + - name: Check the built archives + run: | + twine check dist/* + pip install dist/*.whl + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.pypi_token }} + repository_url: https://upload.pypi.org/legacy/ + verify_metadata: true \ No newline at end of file