Skip to content

Workflow file for this run

# Copied from https://github.com/Ouranosinc/xclim
name: Publish Python 🐍 distributions πŸ“¦ to PyPI
on:
release:
types:
- published
permissions:
contents: read
jobs:
build-n-publish-pypi:
name: Build and publish Python 🐍 distributions πŸ“¦ to PyPI
environment: production
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
files.pythonhosted.org:443
github.com:443
pypi.org:443
ruf-repo-cdn.sigstore.dev:443
upload.pypi.org:443
- name: Checkout Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Python3
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
with:
python-version: "3.x"
- name: Install packaging libraries
run: |
python -m pip install -r CI/requirements_ci.txt
- name: Build a binary wheel and a source tarball
run: |
python -m flit build
- name: Publish distribution πŸ“¦ to PyPI
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4