From 2a1c5e4f037cb44788d71e9d1d7a9b4d74685701 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Sun, 10 Sep 2023 15:42:32 +0200 Subject: [PATCH] Use PyPI trusted publishers --- .github/workflows/ci.yml | 15 --------------- .github/workflows/release.yml | 29 +++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 933d986..2f0a7f8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,18 +46,3 @@ jobs: run: | python -m tox - uses: codecov/codecov-action@v3 - publish: - runs-on: ubuntu-latest - needs: - - tests - if: startsWith(github.ref, 'refs/tags') - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - - name: Build a binary wheel and a source tarball - run: pipx run build - - name: Publish distribution 📦 to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - password: ${{ secrets.pypi_token }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..e728db7 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,29 @@ +on: + release: + types: + - published + +name: release + +jobs: + pypi: + name: upload release to PyPI + runs-on: ubuntu-latest + environment: release + + permissions: + # Used to authenticate to PyPI via OIDC. + id-token: write + + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-python@v4 + with: + python-version: ">= 3.8" + + - name: build + run: pipx run build + + - name: publish + uses: pypa/gh-action-pypi-publish@release/v1