From efe39a26d0e339a6cbcd14c4a0f67d5033166364 Mon Sep 17 00:00:00 2001 From: ljnsn <82611987+ljnsn@users.noreply.github.com> Date: Thu, 7 Mar 2024 01:25:58 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=9A=20ci:=20use=20trusted=20publisher?= =?UTF-8?q?=20(#8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 💚 ci: use trusted publisher * 💚 ci: fix cov path --- .github/workflows/pythonpackage.yml | 2 +- .github/workflows/pythonpublish.yml | 26 +++++++++++--------------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index b2d65b0..8efa1ab 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -64,7 +64,7 @@ jobs: - name: Archive code coverage results uses: actions/upload-artifact@v3 with: - name: coverage-${{ matrix.package }}-${{ matrix.python-version }} + name: coverage-${{ matrix.platform }}-${{ matrix.python-version }} path: reports/.coverage upload-coverage: diff --git a/.github/workflows/pythonpublish.yml b/.github/workflows/pythonpublish.yml index 02f428c..3930fac 100644 --- a/.github/workflows/pythonpublish.yml +++ b/.github/workflows/pythonpublish.yml @@ -6,20 +6,16 @@ on: - "v*" jobs: - deploy: + pypi-publish: + name: upload release to PyPI runs-on: ubuntu-latest + permissions: + # This permission is needed for private repositories. + contents: read + # IMPORTANT: this permission is mandatory for trusted publishing + id-token: write steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.x" - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install pdm>=2.11.1 - - name: Publish - env: - POETRY_PYPI_TOKEN_PYPI: ${{ secrets.POETRY_PYPI_TOKEN_PYPI }} - run: | - python -m pdm publish + - uses: actions/checkout@v3 + - uses: pdm-project/setup-pdm@v3 + - name: Publish package distributions to PyPI + run: pdm publish