From 0199c762b15cb1e1783d20b67b055c8b789aeb56 Mon Sep 17 00:00:00 2001 From: Andreas Schuh <77496589+aschuh-hf@users.noreply.github.com> Date: Thu, 21 Nov 2024 11:06:03 +0000 Subject: [PATCH] [ci] Fix publishing of release to PyPI and Test PyPI --- .github/workflows/release.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index aad4e14..fa9ac59 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -43,12 +43,15 @@ jobs: twine check dist/* env: SETUPTOOLS_SCM_PRETEND_VERSION: ${{ env.version }} + - name: Publish packages to PyPI + if: github.event_name == 'release' + uses: pypa/gh-action-pypi-publish@release/v1 - name: Publish packages to Test PyPI if: ${{ github.event_name == 'release' || (github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/pypi')) }} uses: pypa/gh-action-pypi-publish@release/v1 with: repository-url: https://test.pypi.org/legacy/ + # https://github.com/pypa/gh-action-pypi-publish?tab=readme-ov-file#generating-and-uploading-attestations + # See also issue https://github.com/pypa/gh-action-pypi-publish/issues/283 when using gh-action-pypi-publish twice. + attestations: false skip-existing: true - - name: Publish packages to PyPI - if: github.event_name == 'release' - uses: pypa/gh-action-pypi-publish@release/v1 \ No newline at end of file