From c91139a34a97f3b77488b5eea8bbd15d7e0c3d7a Mon Sep 17 00:00:00 2001 From: Leonardo Cristella Date: Fri, 1 Nov 2024 15:59:40 +0100 Subject: [PATCH] Add GH action to build and publish package (#1) --- .github/workflows/on_tag.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/on_tag.yml diff --git a/.github/workflows/on_tag.yml b/.github/workflows/on_tag.yml new file mode 100644 index 0000000..a74099e --- /dev/null +++ b/.github/workflows/on_tag.yml @@ -0,0 +1,29 @@ +name: Publish sdist tarball to PyPi + +on: + push: + tags: + - "*" + +jobs: + build-n-publish: + name: Build and publish on PyPI + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: Set up Python 3.9 + uses: actions/setup-python@v5 + with: + python-version: 3.9 + - name: Build a source tarball + run: | + python -m pip install --upgrade pip + python -m pip install build + - name: Build a source tarball + run: | + python -m build + - name: Publish distribution package to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_API_TOKEN }} + verbose: true