Skip to content

Publish to PyPI

Publish to PyPI #5

Workflow file for this run

name: Publish to PyPI
on:
# Allows manual run from the Actions tab
workflow_dispatch:
jobs:
build:
name: Build distribution
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.x'
- name: Build
run: |
python -m pip install build --user
python -m build
- name: Store packages
uses: actions/upload-artifact@v6
with:
name: python-package-distributions
path: dist/
publish-to-pypi:
name: Publish distribution to PyPI
runs-on: ubuntu-latest
needs:
- build
environment:
name: pypi
url: https://pypi.org/project/emodpy
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Download distribution files
uses: actions/download-artifact@v7
with:
name: python-package-distributions
path: dist/
- name: Upload files to PyPI
uses: pypa/gh-action-pypi-publish@release/v1