From 8e4a96fb381a69fc807028aad7b2fba7407ab697 Mon Sep 17 00:00:00 2001 From: Matyas Richter Date: Sat, 14 Sep 2024 21:09:08 +0200 Subject: [PATCH] Add Github Actions release workflow --- .github/workflows/release.yml | 50 +++++++++++++++++++++++++++++++++++ 1 file changed, 50 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..8b0df41 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,50 @@ +--- +on: + release: + types: [published] + +jobs: + release-build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: "3.x" + + - name: Install requirements + run: | + pip install poetry + poetry install + poetry self add poetry-version-plugin + + - name: Build + run: poetry build + + - name: Upload build output + uses: actions/upload-artifact@v4 + with: + name: release-dists + path: dist/ + + pypi-publish: + environment: pypi + runs-on: ubuntu-latest + needs: + - release-build + permissions: + id-token: write + packages: write + contents: write + + steps: + - name: Retrieve release distributions + uses: actions/download-artifact@v4 + with: + name: release-dists + path: dist/ + + - name: Publish release distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1