Skip to content

Commit

Permalink
ci.yml: PyPI uses OIDC for auth (#138)
Browse files Browse the repository at this point in the history
Switch our pypi publish CI step to use OIDC for authentication to pypi.org and test.pypi.org.
  • Loading branch information
james-rms committed Nov 24, 2023
1 parent b00faa3 commit 4474e3b
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ jobs:
defaults:
run:
working-directory: python
permissions:
id-token: write
steps:
- uses: actions/checkout@v3
- uses: arduino/setup-protoc@v1
Expand All @@ -93,8 +95,6 @@ jobs:
uses: pypa/gh-action-pypi-publish@release/v1
if: ${{ !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' }}
with:
user: __token__
password: ${{ secrets.TESTPYPI_API_TOKEN }}
packages_dir: python/foxglove-schemas-flatbuffer/dist
repository_url: https://test.pypi.org/legacy/
skip_existing: true
Expand All @@ -106,16 +106,12 @@ jobs:
startsWith(github.ref, 'refs/tags/releases/python/foxglove-schemas-flatbuffer/v')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages_dir: python/foxglove-schemas-flatbuffer/dist

- name: Publish foxglove-schemas-protobuf to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: ${{ !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' }}
with:
user: __token__
password: ${{ secrets.TESTPYPI_API_TOKEN }}
packages_dir: python/foxglove-schemas-protobuf/dist
repository_url: https://test.pypi.org/legacy/
skip_existing: true
Expand All @@ -127,8 +123,6 @@ jobs:
startsWith(github.ref, 'refs/tags/releases/python/foxglove-schemas-protobuf/v')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages_dir: python/foxglove-schemas-protobuf/dist

ros:
Expand Down

0 comments on commit 4474e3b

Please sign in to comment.