diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 00000000..8bf0c461 --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,7 @@ +# Configures the automatically generated release notes: +# https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes +changelog: + exclude: + authors: + - dependabot[bot] + - pre-commit-ci[bot] diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d108553d..5db335be 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,22 +3,30 @@ name: Release on: push: tags: - - '*' + - '*' + - '!*.dev*' + +env: + PYPI_URL: https://pypi.org/p/django-push-notifications + +permissions: {} jobs: build: - if: github.repository == 'jazzband/django-push-notifications' + if: github.repository == 'django-commons/django-push-notifications' runs-on: ubuntu-24.04 + permissions: + contents: read steps: - - uses: actions/checkout@v7 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: - fetch-depth: 0 + persist-credentials: false - name: Set up Python - uses: actions/setup-python@v7 + uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7 with: - python-version: 3.8 + python-version: '3.x' - name: Install dependencies run: | @@ -30,10 +38,60 @@ jobs: python -m build twine check dist/* - - name: Upload packages to Jazzband - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') - uses: pypa/gh-action-pypi-publish@release/v1 + - name: Store the distribution packages + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7 + with: + name: python-package-distributions + path: dist/ + + publish-to-pypi: + needs: + - build + runs-on: ubuntu-24.04 + environment: + name: pypi + url: ${{ env.PYPI_URL }} + permissions: + id-token: write + + steps: + - name: Download all the dists + uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8 with: - user: jazzband - password: ${{ secrets.JAZZBAND_RELEASE_KEY }} - repository_url: https://jazzband.co/projects/django-push-notifications/upload + name: python-package-distributions + path: dist/ + + - name: Publish package to PyPI + uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3 + + github-release: + needs: + - publish-to-pypi + runs-on: ubuntu-24.04 + permissions: + contents: write + + steps: + - name: Download all the dists + uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8 + with: + name: python-package-distributions + path: dist/ + + - name: Create GitHub Release + env: + GITHUB_TOKEN: ${{ github.token }} + run: >- + gh release create + "${GITHUB_REF_NAME}" + --repo '${{ github.repository }}' + --draft + --generate-notes + + - name: Upload packages to GitHub Release + env: + GITHUB_TOKEN: ${{ github.token }} + run: >- + gh release upload + "${GITHUB_REF_NAME}" dist/** + --repo '${{ github.repository }}' diff --git a/ACKNOWLEDGEMENTS.md b/ACKNOWLEDGEMENTS.md index 4f73c064..288fc7d8 100644 --- a/ACKNOWLEDGEMENTS.md +++ b/ACKNOWLEDGEMENTS.md @@ -13,4 +13,4 @@ Pablo Martín The full contributor list is available at the following URL: -https://github.com/jazzband/django-push-notifications/graphs/contributors +https://github.com/django-commons/django-push-notifications/graphs/contributors diff --git a/CHANGELOG.md b/CHANGELOG.md index 17750d69..c8d5face 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,6 @@ ## 2.0.0 (unreleased) +* Switch from Jazzband org to Django Commons +* Switched to trusted publisher release process with Django Commons * BACKWARDS-INCOMPATIBLE: Drop support for Django Rest Framework < 3.7 * BACKWARDS-INCOMPATIBLE: NotificationError is now moved from `__init__.py` to `exceptions.py` * Import with `from push_notifications.exceptions import NotificationError` diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index ead2f7f6..f36fb389 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,8 +1,5 @@ # Code of Conduct -The django-push-notifications project adopts the [Django Commons Code of Conduct](https://github.com/django-commons/membership/blob/main/CODE_OF_CONDUCT.md). +The django-push-notifications project utilizes the [Django Commons Code of Conduct](https://github.com/django-commons/membership/blob/main/CODE_OF_CONDUCT.md). -By participating in this project, you agree to abide by this Code of Conduct. -Please report violations to the Django Commons Code of Conduct team at -[django-commons-coc@googlegroups.com](mailto:django-commons-coc@googlegroups.com), -following the reporting guidance in the Code of Conduct. +--- diff --git a/README.rst b/README.rst index c7f5bd9d..47a1f705 100644 --- a/README.rst +++ b/README.rst @@ -1,16 +1,12 @@ django-push-notifications ========================= -.. image:: https://jazzband.co/static/img/badge.svg - :target: https://jazzband.co/ - :alt: Jazzband - -.. image:: https://github.com/jazzband/django-push-notifications/workflows/Test/badge.svg - :target: https://github.com/jazzband/django-push-notifications/actions +.. image:: https://github.com/django-commons/django-push-notifications/workflows/Test/badge.svg + :target: https://github.com/django-commons/django-push-notifications/actions :alt: GitHub Actions -.. image:: https://codecov.io/gh/jazzband/django-push-notifications/branch/master/graph/badge.svg?token=PcC594rhI4 - :target: https://codecov.io/gh/jazzband/django-push-notifications +.. image:: https://codecov.io/gh/django-commons/django-push-notifications/branch/master/graph/badge.svg?token=PcC594rhI4 + :target: https://codecov.io/gh/django-commons/django-push-notifications :alt: Code coverage A minimal Django app that implements Device models that can send messages through APNS, FCM/GCM, WNS and WebPush. @@ -75,17 +71,17 @@ Edit your settings.py file: } .. note:: - To migrate from legacy FCM APIs to HTTP v1, see `docs/FCM `_. + To migrate from legacy FCM APIs to HTTP v1, see `docs/FCM `_. .. note:: - If you need to support multiple mobile applications from a single Django application, see `Multiple Application Support `_ for details. + If you need to support multiple mobile applications from a single Django application, see `Multiple Application Support `_ for details. .. note:: If you are planning on running your project with ``APNS_USE_SANDBOX=True``, then make sure you have set the *development* certificate as your ``APNS_CERTIFICATE``. Otherwise the app will not be able to connect to the correct host. See settings_ for details. -For more information about how to generate certificates, see `docs/APNS `_. +For more information about how to generate certificates, see `docs/APNS `_. You can learn more about APNS certificates `here `_. @@ -108,7 +104,7 @@ For WNS, you need both the ``WNS_PACKAGE_SECURITY_KEY`` and the ``WNS_SECRET_KEY **APNS settings** -- ``APNS_CERTIFICATE``: Absolute path to your APNS certificate file. Certificates with passphrases are not supported. If iOS application was build with "Release" flag, you need to use production certificate, otherwise debug. Read more about `Generation of an APNS PEM file `_. +- ``APNS_CERTIFICATE``: Absolute path to your APNS certificate file. Certificates with passphrases are not supported. If iOS application was build with "Release" flag, you need to use production certificate, otherwise debug. Read more about `Generation of an APNS PEM file `_. - ``APNS_AUTH_KEY_PATH``: Absolute path to your APNS signing key file for `Token-Based Authentication `_ . Use this instead of ``APNS_CERTIFICATE`` if you are using ``.p8`` signing key certificate. - ``APNS_AUTH_KEY_ID``: The 10-character Key ID you obtained from your Apple developer account - ``APNS_TEAM_ID``: 10-character Team ID you use for developing your company’s apps for iOS. @@ -133,7 +129,7 @@ For WNS, you need both the ``WNS_PACKAGE_SECURITY_KEY`` and the ``WNS_SECRET_KEY - ``WP_CLAIMS``: Dictionary with default value for the sub, (subject), sent to the webpush service, This would be used by the service if they needed to reach out to you (the sender). Could be a url or mailto e.g. {'sub': "mailto:development@example.com"}. - ``WP_ERROR_TIMEOUT``: The timeout on WebPush POSTs. (Optional, default value is 1 second) -For more information about how to configure WebPush, see `docs/WebPush `_. +For more information about how to configure WebPush, see `docs/WebPush `_. Sending messages diff --git a/docs/conf.py b/docs/conf.py index 40f48bf9..931ff7b7 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,5 +1,6 @@ project = "django-push-notifications" author = "django-push-notifications contributors" +copyright = "2018-2026, Jazzband; 2026, Django Commons" extensions = [] root_doc = "index" diff --git a/docs/index.rst b/docs/index.rst index ef9f21fc..dae9b549 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -15,5 +15,5 @@ A Django app for sending push notifications through APNS, FCM/GCM, WNS and WebPu Contributing ------------ -See the `contribution guide `_ -and `Code of Conduct `_. +See the `contribution guide `_ +and `Code of Conduct `_. diff --git a/setup.cfg b/setup.cfg index 82f7625a..26e13e72 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,8 +3,8 @@ name = django-push-notifications description = Send push notifications to mobile devices through GCM, APNS or WNS and to WebPush (Chrome, Firefox and Opera) in Django author = Jerome Leclanche author_email = jerome@leclan.ch -url = https://github.com/jazzband/django-push-notifications -download_url = https://github.com/jazzband/django-push-notifications/tarball/master +url = https://github.com/django-commons/django-push-notifications +download_url = https://github.com/django-commons/django-push-notifications/tarball/master classifiers = Development Status :: 5 - Production/Stable Environment :: Web Environment diff --git a/tests/settings.py b/tests/settings.py index a5da8a5e..85b7ba8f 100644 --- a/tests/settings.py +++ b/tests/settings.py @@ -26,5 +26,5 @@ SECRET_KEY = "foobar" PUSH_NOTIFICATIONS_SETTINGS = { - "WP_CLAIMS": {"sub": "mailto:jazzband@example.com"} + "WP_CLAIMS": {"sub": "mailto:django-commons@example.com"} } diff --git a/tests/settings_unique.py b/tests/settings_unique.py index e7429943..adf7ff30 100644 --- a/tests/settings_unique.py +++ b/tests/settings_unique.py @@ -26,6 +26,6 @@ SECRET_KEY = "foobar" PUSH_NOTIFICATIONS_SETTINGS = { - "WP_CLAIMS": {"sub": "mailto:jazzband@example.com"}, + "WP_CLAIMS": {"sub": "mailto:django-commons@example.com"}, "UNIQUE_REG_ID": True }