From 62f3973af3dae53014d518dde4208a9c76e98dac Mon Sep 17 00:00:00 2001 From: Mark Walker Date: Mon, 18 Mar 2024 23:49:01 +0000 Subject: [PATCH] ci: Switch to trusted publishing --- .github/dependabot.yml | 6 ++++++ .github/workflows/publish-to-live-pypi.yml | 10 ++++++---- .github/workflows/publish-to-test-pypi.yml | 9 ++++++--- 3 files changed, 18 insertions(+), 7 deletions(-) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..6c05d0e3 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: +- package-ecosystem: github-actions + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/publish-to-live-pypi.yml b/.github/workflows/publish-to-live-pypi.yml index 49928def..b2da945a 100644 --- a/.github/workflows/publish-to-live-pypi.yml +++ b/.github/workflows/publish-to-live-pypi.yml @@ -9,10 +9,15 @@ jobs: build-n-publish: name: Build and publish Python 🐍 distributions 📦 to pypi runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/djangocms-text + permissions: + id-token: write steps: - uses: actions/checkout@master - name: Set up Python 3.12 - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: 3.12 @@ -41,6 +46,3 @@ jobs: - name: Publish distribution 📦 to PyPI if: startsWith(github.ref, 'refs/tags') uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index ac05ac41..fc991411 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -9,10 +9,15 @@ jobs: build-n-publish: name: Build and publish Python 🐍 distributions 📦 to TestPyPI runs-on: ubuntu-latest + environment: + name: test + url: https://test.pypi.org/p/djangocms-text + permissions: + id-token: write steps: - uses: actions/checkout@master - name: Set up Python 3.12 - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: 3.12 @@ -42,7 +47,5 @@ jobs: - name: Publish distribution 📦 to Test PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: - user: __token__ - password: ${{ secrets.TEST_PYPI_API_TOKEN }} repository-url: https://test.pypi.org/legacy/ skip-existing: true