From 7e26cef5e08f1a92e3c76c4c07669ca4bbd0792b Mon Sep 17 00:00:00 2001 From: Alexandre Muller Date: Wed, 10 Jan 2024 11:22:51 +0100 Subject: [PATCH] github: add integration to PyPI --- .github/workflows/publish-to-pypi.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/publish-to-pypi.yml diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml new file mode 100644 index 0000000..7a561ea --- /dev/null +++ b/.github/workflows/publish-to-pypi.yml @@ -0,0 +1,27 @@ +name: Publish Python distribution to PyPI + +on: push + +jobs: + publish-to-pypi: + name: Publish Python distribution to PyPI + if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/metaset + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing + + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.12" + - name: Install pypa/build + run: pip install build + - name: Build a binary wheel and a source tarball + run: python3 -m build + - name: Publish distribution to PyPI + uses: pypa/gh-action-pypi-publish@release/v1