Skip to content

feat/publish: add trusted publisher support to CI #271

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 27, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# This workflow will upload a Python Package using Twine when a release is created
# This workflow will upload a Python Package using Trusted Publishers automatically when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
# and https://docs.pypi.org/trusted-publishers/using-a-publisher/.

name: Upload Python Package

Expand All @@ -8,9 +9,17 @@ on:
types: [created]

jobs:
deploy:

pypi-publish:
runs-on: ubuntu-latest

environment:
name: pypi
url: https://pypi.org/project/tldr/

permissions:
contents: read
id-token: write # Required for accessing OpenID Connect (OIDC) token for PyPI trusted publisher

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

Expand Down Expand Up @@ -57,6 +66,3 @@ jobs:

- name: Publish package
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}