From 8bb2d041d6d6490d3a530ee9d25ab09077b74555 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Tue, 6 Feb 2024 20:53:02 +0100 Subject: [PATCH] GitHub Action to release to PyPI * https://github.com/pypa/gh-action-pypi-publish --- .github/workflows/release.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 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 00000000..f074199f --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,33 @@ +name: Release + +on: + push: + tags: + - '*' + +jobs: + build: + if: github.repository == 'celery/django-celery-beat' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-python@v5 + with: + python-version: 3.x + - run: python -m pip install --upgrade pip + - run: python -m pip install --upgrade build twine + - run: python -m build + - run: twine check dist/* + + pypi-publish: + needs: build + runs-on: ubuntu-latest + steps: + - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + name: Publish package to TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.CELERY_PYPI_TOKEN }} + repository-url: https://pypi.org/p/django-celery-beat