Skip to content

Commit

Permalink
fix pypi publishing (#1312)
Browse files Browse the repository at this point in the history
### Changelog
None
### Docs

None

### Description

See also foxglove/schemas#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
pypa/gh-action-pypi-publish#283 (comment)
is to set `attestations: false` on the TestPyPI publish.
  • Loading branch information
jtbandes authored Jan 15, 2025
1 parent 6c9ce28 commit d878a72
Showing 1 changed file with 20 additions and 16 deletions.
36 changes: 20 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -315,65 +315,69 @@ 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: |
!github.event.pull_request.head.repo.fork &&
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: |
!github.event.pull_request.head.repo.fork &&
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: |
!github.event.pull_request.head.repo.fork &&
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: |
!github.event.pull_request.head.repo.fork &&
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
Expand Down

0 comments on commit d878a72

Please sign in to comment.