From 1bf441ecb0a3b062fcdd24598988cb4b29bd0a0b Mon Sep 17 00:00:00 2001 From: Conor Walsh Date: Wed, 7 Aug 2024 17:06:09 +0100 Subject: [PATCH] [BUILD] Add workflow to release to PyPi - LRN-43927 --- .github/workflows/pypi-release.yml | 39 ++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/pypi-release.yml diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml new file mode 100644 index 0000000..41c7202 --- /dev/null +++ b/.github/workflows/pypi-release.yml @@ -0,0 +1,39 @@ +# This workflow will release to PyPi + +name: Release to PyPi + +on: + release: + types: [published] + workflow_dispatch: + +permissions: + contents: read + +jobs: + pypi-publish: + name: upload release to PyPI + runs-on: ubuntu-latest + permissions: + id-token: write + steps: + - name: Check out code + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + + - name: Build and check Python distributions + run: | + python setup.py sdist bdist_wheel + twine check dist/* + + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1