Skip to content

gha-pypi-publish

gha-pypi-publish #2

Workflow file for this run

# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://github.com/marketplace/actions/pypi-publish
name: gha-pypi-publish
on:
release:
types: [created]
jobs:
pypi-publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
environment:
name: testpypi # pypi
url: https://test.pypi.org/p/adepy # https://pypi.org/p/adepy
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
# retrieve your distributions here
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install wheel twine build
- name: Build package
run: python -m build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/