From 1cc1babcfe2f532675de8d4e7be19fb2014769d9 Mon Sep 17 00:00:00 2001 From: James B Date: Wed, 13 Nov 2024 15:41:09 +0000 Subject: [PATCH 1/2] pypi: Automatic Releases --- .github/workflows/pypi.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/pypi.yml diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml new file mode 100644 index 0000000..e30317c --- /dev/null +++ b/.github/workflows/pypi.yml @@ -0,0 +1,32 @@ +name: Upload release to PyPI (Test & Live) +on: + push: + branches: [main] + release: + types: [published] + +jobs: + pypi-publish: + name: Upload release to PyPI (Test & Live) + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/libcoveweb + permissions: + id-token: write # IMPORTANT: this permission is mandatory for trusted publishing + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + - run: pip install --upgrade build + - run: python -m build --sdist --wheel + - name: Publish package distributions to TEST PyPI + if: github.event_name == 'push' + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ + skip-existing: true + - name: Publish package distributions to LIVE PyPI + if: github.event_name == 'release' + uses: pypa/gh-action-pypi-publish@release/v1 From db4de3bcf892243fa5764338e7396d05fd7d91d5 Mon Sep 17 00:00:00 2001 From: James B Date: Wed, 13 Nov 2024 15:42:59 +0000 Subject: [PATCH 2/2] setup.py: Set long_description and type This was causing a pypi deploy error, `long_description` has syntax errors in markup and would not be rendered on PyPI. No content rendered from RST source. --- setup.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.py b/setup.py index afbb720..07e3c28 100644 --- a/setup.py +++ b/setup.py @@ -25,6 +25,8 @@ scripts=['manage.py'], url='https://github.com/OpenDataServices/lib-cove-web', description='', + long_description="", + long_description_content_type="text/plain", classifiers=[ 'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)', ],