flatbuffers icon indicating copy to clipboard operation
flatbuffers copied to clipboard

Publish Python package with official action

Open EpicWink opened this issue 1 month ago • 0 comments

See the Python packaging documentation, the PyPI documentation, and the official pypi-publish GitHub action documentation on trusted publishing.

Actions (click to expand)
  • Configure (or use an existing) GitHub environment and add to PyPI
  • In the Publish PyPi job of the Release CI workflow:
    • add aforementioned environment (eg name pypi), and permissions:
      + environment:
      +   name: pypi
      +   url: https://pypi.org/p/flatbuffers
      + permissions:
      +   id-token: write
      +   contents: read
      
    • in the Upload to PyPi step, switch to using the action:
      - run: python3 -m twine upload dist/*
      + uses: pypa/gh-action-pypi-publish@release/v1`
      
    • in the Install Dependencies step, remove twine:
      - python3 -m pip install setuptools wheel twine
      + python3 -m pip install setuptools wheel
      
  • You will be able to remove the TWINE_TOKEN project secret

Related: #8731

EpicWink avatar Oct 20 '25 09:10 EpicWink