From aadd0621390ea6749301815d2fa046137ceedd9a Mon Sep 17 00:00:00 2001 From: Clemens Brunner Date: Wed, 17 Jul 2024 16:24:47 +0200 Subject: [PATCH] Add release GitHub Action (#108) --- .github/workflows/release.yml | 47 +++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..5771b73 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,47 @@ +name: Release + +on: + release: + types: [published] + +jobs: + style: + name: Check style + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: chartboost/ruff-action@v1 + - uses: chartboost/ruff-action@v1 + with: + args: 'format --check' + + build: + needs: style + name: Build package + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + - name: Build sdist and wheel + run: | + pip install build + python -m build + - uses: actions/upload-artifact@v4 + with: + name: dist + path: dist + + upload-pypi: + name: Upload to PyPI + needs: build + runs-on: ubuntu-22.04 + permissions: + id-token: write + steps: + - uses: actions/download-artifact@v4 + with: + name: dist + path: dist + - uses: pypa/gh-action-pypi-publish@v1.9.0