From 9d2075730ed64f15381f1c320e00a43c2e1a3b4c Mon Sep 17 00:00:00 2001 From: Samuel Burbulla Date: Tue, 20 Aug 2024 16:12:57 +0200 Subject: [PATCH] Update PyPI publish workflow. --- .github/workflows/publish.yml | 34 +++++++++------------------------- 1 file changed, 9 insertions(+), 25 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index d0bd500b..476e74e4 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -8,29 +8,13 @@ on: jobs: publish: runs-on: ubuntu-latest - concurrency: - group: publish + # Specifying a GitHub environment is optional, but strongly encouraged + environment: release + permissions: + # IMPORTANT: this permission is mandatory for trusted publishing + id-token: write steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: 3.11 - cache: "pip" - - name: Install - run: | - pip install ".[dev]" - - name: Get Current Version - run: | - export CURRENT_VERSION=$(bump-my-version show current_version) - echo CURRENT_VERSION=$CURRENT_VERSION >> $GITHUB_ENV - shell: bash - - name: Build and publish to PyPI - env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - run: | - python3 -m pip install --upgrade build twine - python3 -m build - python3 -m twine upload --verbose --non-interactive dist/* + # retrieve your distributions here + + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1