From fa6870eef7d4cff9d690656ec02f37bc6641bd10 Mon Sep 17 00:00:00 2001 From: Aarni Koskela Date: Thu, 8 Feb 2024 13:50:09 +0200 Subject: [PATCH] Set up publishing to PyPI (#3) --- .github/workflows/ci.yml | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5435bb1..b4ba6a9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,6 +4,8 @@ on: push: branches: - master + tags: + - "v*" pull_request: jobs: @@ -36,7 +38,28 @@ jobs: steps: - uses: actions/checkout@v4 - run: pip install build && python -m build - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: wheel path: dist/*.whl + Publish: + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + needs: + - Build + name: Upload release to PyPI + runs-on: ubuntu-latest + environment: + name: release + url: https://pypi.org/p/django-urr/ + permissions: + id-token: write + steps: + - uses: actions/download-artifact@v3 + with: + name: dist + path: dist/ + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + verbose: true + print-hash: true