🌐
GitHub
github.com › marketplace › actions › pypi-publish
pypi-publish · Actions · GitHub Marketplace · GitHub
To enter the trusted publishing flow, configure this action's job with the id-token: write permission and without an explicit username or password: # .github/workflows/ci-cd.yml jobs: pypi-publish: name: Upload release to PyPI runs-on: ubuntu-latest environment: name: pypi url: https://pypi.org/p/<your-pypi-project-name> permissions: id-token: write # IMPORTANT: this permission is mandatory for trusted publishing steps: # retrieve your distributions here - name: Publish package distributions to PyPI uses: pypa/gh-action-pypi-publish@release/v1
🌐
GitHub
github.com › pypa › gh-action-pypi-publish
GitHub - pypa/gh-action-pypi-publish: The blessed GitHub Action, for publishing your distribution files to PyPI, the tokenless way: https://github.com/marketplace/actions/pypi-publish · GitHub
The blessed :octocat: GitHub Action, for publishing your :package: distribution files to PyPI, the tokenless way: https://github.com/marketplace/actions/pypi-publish - pypa/gh-action-pypi-publish
Author: pypa
🌐
Python Packaging
packaging.python.org › en › latest › guides › publishing-package-distribution-releases-using-github-actions-ci-cd-workflows
Publishing package distribution releases using GitHub Actions CI/CD workflows - Python Packaging User Guide
This step uses the pypa/gh-action-pypi-publish GitHub Action: after the stored distribution package has been downloaded by the download-artifact action, it uploads the contents of the dist/ folder into PyPI unconditionally.
🌐
Caktusgroup
caktusgroup.com › blog › 2021 › 02 › 11 › automating-pypi-releases
Automating PyPI releases with Github Actions | Caktus Group
(If you don’t update the version number, then twine will return a 400 error because PyPI will properly not let you overwrite an existing package with the same version.) Create a new Release in the Github UI. Step 2 kicks off a Github Action that will build your package and upload it to PyPI, thus eliminating my silly blocker of having to remember how to do this manually, and I can update our open source packages more efficiently!
🌐
Simon Willison
til.simonwillison.net › pypi › pypi-releases-from-github
Publish releases to PyPI from GitHub Actions without a password or token | Simon Willison’s TILs
It uses the pypa/gh-action-pypi-publish action to publish the package. Note that it doesn't need any settings - it just works, provided the trusted publisher on PyPI has been configured. With all this in place, all that's needed to ship a package is to ensure the version is set correctly in the pyproject.toml file (or setup.py file if you're using that instead), then create a new release on GitHub.
🌐
PyPI
pypi.org › project › github-action-utils
github-action-utils
JavaScript is disabled in your browser. Please enable JavaScript to proceed · A required part of this site couldn’t load. This may be due to a browser extension, network issues, or browser settings. Please check your connection, disable any ad blockers, or try using a different browser
🌐
DEV Community
dev.to › arnu515 › create-a-pypi-pip-package-test-it-and-publish-it-using-github-actions-part-2-1o83
Create a PyPI (pip) package, test it and publish it using Github Actions (PART 2) - DEV Community
January 15, 2021 - # This is a basic workflow to help you get started with Actions name: Upload to PIP # Controls when the action will run. on: # Triggers the workflow when a release is created release: types: [created] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: # This workflow contains a single job called "upload" upload: # The type of runner that the job will run on runs-on: ubuntu-latest # Steps represent a sequence of tasks that will be executed as part of the job steps: # Ch
🌐
PyPI
pypi.org › project › GitHub-Action-Python-Example
Pypi
February 11, 2021 - JavaScript is disabled in your browser. Please enable JavaScript to proceed · A required part of this site couldn’t load. This may be due to a browser extension, network issues, or browser settings. Please check your connection, disable any ad blockers, or try using a different browser
🌐
Medium
medium.com › @VersuS_ › automate-pypi-releases-with-github-actions-4c5a9cfe947d
Automate PyPi releases with Github Actions | by Diego Velez | Medium
June 8, 2022 - 4. Define Github workflow file Just copy and paste the file under repository/.github/workflows/pipy_release.yml Things you might want to change - Python version - Runner (https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners) name: Publish Python 🐍 distributions 📦 to PyPI on: push: tags: - '*' jobs: build-n-publish: name: Build and publish Python 🐍 distributions 📦 to PyPI runs-on: ubuntu-18.04 steps: - uses: actions/checkout@master - name: Set up Python 3.10 uses: actions/setup-python@v3 with: python-version: '3.10' - name: Install pypa/setuptoo
Find elsewhere
🌐
GitHub
github.com › kaikodata › github-action-pypi-publish
GitHub - kaikodata/github-action-pypi-publish: GitHub Action, for publishing distribution files to PyPI · GitHub
This action allows you to upload your Python distribution packages in the dist/ directory to PyPI. This text suggests a minimalistic usage overview.
Author: kaikodata
🌐
GitHub
github.com › marketplace › actions › pypi-deployment
PyPI Deployment · Actions · GitHub Marketplace · GitHub
Securely build and upload Python distributions to PyPI. steps: - uses: actions/checkout@v6 - uses: actions/setup-python@v6 - uses: casperdcl/deploy-pypi@v2 with: build: --outdir dist .
🌐
GitHub
github.com › pypi › support › actions
Actions · pypi/support
Issue tracker for support requests related to using https://pypi.org - Actions · pypi/support
Author: pypi
🌐
Reddit
reddit.com › r/learnpython › publishing to pypi via github action
r/learnpython on Reddit: Publishing to PyPI via GitHub Action
January 30, 2023 -

I am trying to learn how to publish a python package onto PyPI and I'm a little stuck with setting up a github action to publish a release, specifically with the code that runs when I push with a tag.

I am trying to follow the semantic versioning practice (as recommended), so my pyproject.toml file has the initial version set to version = "0.1.0". (I didn't set it up before but that's fine - I'd like my next version to be 0.1.1 after some additional changes). I expect to manually change it, create a tag, and push that to my main branch for the action to run.

In the documentation example, I see that the action yaml file contains the line uses: pypa/gh-action-pypi-publish@release/v1. I have never done this before and almost went with that, but I am not sure why the example shows v1 hardcoded, so I don't think I actually want this to happen. It doesn't seem to be well explained though, and the pypi-publish action repo was also quiet on this. Is this saying that it will create a release branch in my repo and call the release v1? Or how will this appear after I've done it? Will I have to manually change this v1 to v0.1.1 in the actions file AND the pyproject.toml?

I saw a video giving a demo, but the uses command in that was outdated (it showed master branch) and it seemed clearer, so I don't really know what to do about it.

🌐
DEV Community
dev.to › leading-edje › pypi-release-using-github-actions-4f9a
PyPI release using GitHub Actions - DEV Community
August 16, 2020 - - name: Package and Upload env: STACKMANAGER_VERSION: ${{ github.event.release.tag_name }} TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_APIKEY }} run: | python setup.py sdist bdist_wheel twine upload dist/* ... I have a very similar action for my packages, but I've been bumping versions manually for all this time, this changes everything.
🌐
DEV Community
dev.to › harisharavindan › pypi-packages-with-github-actions-45ig
pypi packages with GitHub actions - DEV Community
September 26, 2021 - https://github.com/uptownaravi/encoder/blob/main/.github/workflows/pythonaction.yml · This is configured to run when a commit happens on the main branch. ... Once we make a commit on the main branch, we can see the workflow run on the actions tab of the repository · After the job run we can see our package in pypi webpage.
🌐
seanh.cc
seanh.cc › 2022 › 05 › 21 › publishing-python-packages-from-github-actions
How to Publish a Python Package from GitHub Actions - seanh.cc
May 21, 2022 - Enter PYPI_API_TOKEN as the name and paste in the PyPI API token as the value then click Add secret: publish.yml is a GitHub Actions workflow that triggers whenever a GitHub release is created. It builds the Python package and uploads it to PyPI.
🌐
Endjin
endjin.com › home › what we think › blog
Continuous Deployment of Python Packages with GitHub Actions
May 4, 2026 - This ensures that the environment on the GitHub runner in which the code is being ran has the necessary dependencies installed that the code requires, these are the same dependencies as in the development environment (i.e. the environment used to develop the package), and are the dependencies that will need to be installed by anyone wanting to use this package (i.e. the production environment). ... - name: Publish to TestPyPI uses: pypa/gh-action-pypi-publish@release/v1 with: user: __token__ password: ${{ secrets.TEST_PYPI_API_TOKEN }} repository_url: https://test.pypi.org/legacy/
🌐
GitHub
github.com › marketplace › actions › pypi-poetry-publish
PyPI Poetry Publish · Actions · GitHub Marketplace · GitHub
Opinionated GitHub action to fully automate publishing packages to any PyPI registry - using Poetry and GitHub releases
🌐
GitHub
github.com › pypa › gh-action-pypi-publish › releases
Releases · pypa/gh-action-pypi-publish
The blessed :octocat: GitHub Action, for publishing your :package: distribution files to PyPI, the tokenless way: https://github.com/marketplace/actions/pypi-publish - Releases · pypa/gh-action-pypi-publish
Author: pypa