Skip to content

Commit

Permalink
GHA: Use PyPI OIDC for publishing (#486)
Browse files Browse the repository at this point in the history
Replace token based authentication with OIDC for PyPI package
publishing.

Relates to #467
  • Loading branch information
jorisroovers authored Apr 11, 2023
1 parent 7f55b01 commit 562703f
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ jobs:
publish:
timeout-minutes: 15
runs-on: "ubuntu-latest"
permissions:
# Required for trusted publishing to PyPI
id-token: write
outputs:
gitlint_version: ${{ steps.set_version.outputs.gitlint_version }}
steps:
Expand Down Expand Up @@ -107,27 +110,22 @@ jobs:
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: gitlint-core/dist/
password: ${{ secrets.PYPI_GITLINT_CORE_PASSWORD }}
if: inputs.pypi_target == 'pypi.org'

- name: Publish gitlint πŸπŸ“¦ to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_GITLINT_PASSWORD }}
if: inputs.pypi_target == 'pypi.org'

- name: Publish gitlint-core πŸπŸ“¦ to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: gitlint-core/dist/
password: ${{ secrets.TEST_PYPI_GITLINT_CORE_PASSWORD }}
repository-url: https://test.pypi.org/legacy/
if: inputs.pypi_target == 'test.pypi.org'

- name: Publish gitlint πŸπŸ“¦ to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_GITLINT_PASSWORD }}
repository-url: https://test.pypi.org/legacy/
if: inputs.pypi_target == 'test.pypi.org'

Expand Down

0 comments on commit 562703f

Please sign in to comment.