From d878a72a2f8373f58006ad811d372eea85f98060 Mon Sep 17 00:00:00 2001 From: Jacob Bandes-Storch Date: Wed, 15 Jan 2025 14:01:41 -0800 Subject: [PATCH] fix pypi publishing (#1312) ### Changelog None ### Docs None ### Description See also https://github.com/foxglove/schemas/pull/158. > Running a publish to TestPyPI immediately followed by a publish to the "real" PyPI triggered an error due to a file already existing. The workaround recommended in https://github.com/pypa/gh-action-pypi-publish/issues/283#issuecomment-2499296440 is to set `attestations: false` on the TestPyPI publish. --- .github/workflows/ci.yml | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4e15e0439..a25695852 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -315,33 +315,37 @@ jobs: uses: pypa/gh-action-pypi-publish@release/v1 if: ${{ !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' }} with: - packages_dir: python/mcap/dist - repository_url: https://test.pypi.org/legacy/ - skip_existing: true + packages-dir: python/mcap/dist + repository-url: https://test.pypi.org/legacy/ + skip-existing: true + attestations: false # https://github.com/pypa/gh-action-pypi-publish/issues/283#issuecomment-2499296440 - name: Publish mcap-protobuf-support to TestPyPI uses: pypa/gh-action-pypi-publish@release/v1 if: ${{ !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' }} with: - repository_url: https://test.pypi.org/legacy/ - skip_existing: true - packages_dir: python/mcap-protobuf-support/dist + repository-url: https://test.pypi.org/legacy/ + skip-existing: true + packages-dir: python/mcap-protobuf-support/dist + attestations: false # https://github.com/pypa/gh-action-pypi-publish/issues/283#issuecomment-2499296440 - name: Publish mcap-ros1-support to TestPyPI uses: pypa/gh-action-pypi-publish@release/v1 if: ${{ !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' }} with: - repository_url: https://test.pypi.org/legacy/ - skip_existing: true - packages_dir: python/mcap-ros1-support/dist + repository-url: https://test.pypi.org/legacy/ + skip-existing: true + packages-dir: python/mcap-ros1-support/dist + attestations: false # https://github.com/pypa/gh-action-pypi-publish/issues/283#issuecomment-2499296440 - name: Publish mcap-ros2-support to TestPyPI uses: pypa/gh-action-pypi-publish@release/v1 if: ${{ !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' }} with: - repository_url: https://test.pypi.org/legacy/ - skip_existing: true - packages_dir: python/mcap-ros2-support/dist + repository-url: https://test.pypi.org/legacy/ + skip-existing: true + packages-dir: python/mcap-ros2-support/dist + attestations: false # https://github.com/pypa/gh-action-pypi-publish/issues/283#issuecomment-2499296440 - name: Publish mcap to PyPI if: | @@ -349,7 +353,7 @@ jobs: startsWith(github.ref, 'refs/tags/releases/python/mcap/v') uses: pypa/gh-action-pypi-publish@release/v1 with: - packages_dir: python/mcap/dist + packages-dir: python/mcap/dist - name: Publish mcap-protobuf-support to PyPI if: | @@ -357,7 +361,7 @@ jobs: startsWith(github.ref, 'refs/tags/releases/python/mcap-protobuf-support/v') uses: pypa/gh-action-pypi-publish@release/v1 with: - packages_dir: python/mcap-protobuf-support/dist + packages-dir: python/mcap-protobuf-support/dist - name: Publish mcap-ros1-support to PyPI if: | @@ -365,7 +369,7 @@ jobs: startsWith(github.ref, 'refs/tags/releases/python/mcap-ros1-support/v') uses: pypa/gh-action-pypi-publish@release/v1 with: - packages_dir: python/mcap-ros1-support/dist + packages-dir: python/mcap-ros1-support/dist - name: Publish mcap-ros2-support to PyPI if: | @@ -373,7 +377,7 @@ jobs: startsWith(github.ref, 'refs/tags/releases/python/mcap-ros2-support/v') uses: pypa/gh-action-pypi-publish@release/v1 with: - packages_dir: python/mcap-ros2-support/dist + packages-dir: python/mcap-ros2-support/dist go: runs-on: ubuntu-latest