From 77a1624c8544e00b24c8edda46766569be1ebb7a Mon Sep 17 00:00:00 2001 From: Caroline Malin-Mayor Date: Tue, 14 May 2024 15:11:11 +0200 Subject: [PATCH] Add pypi workflow --- .github/workflows/deploy.yaml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/deploy.yaml diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 0000000..8d3df16 --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,29 @@ +name: Deploy + +on: + push: + tags: ["*"] + workflow_dispatch: + +jobs: + build-n-publish: + name: Build and publish Python 🐍 distributions 📦 to PyPI + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.x" + - name: Build a binary wheel and a source tarball + run: | + python -m pip install -U pip + python -m pip install build + python -m build --sdist --wheel --outdir dist/ + - name: Publish to PyPI + if: startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_API_TOKEN }} + - uses: softprops/action-gh-release@v2 + with: + generate_release_notes: true