Skip to content

Build Wheel and Release #8

Build Wheel and Release

Build Wheel and Release #8

Workflow file for this run

name: Build Wheel and Release
on:
push:
tags:
- networkx-*
jobs:
pypi-publish:
name: upload release to PyPI
if: github.repository_owner == 'networkx' && startsWith(github.ref, 'refs/tags/networkx-') && github.actor == 'jarrodmillman' && always()
runs-on: ubuntu-latest
# Specifying a GitHub environment is optional, but strongly encouraged
environment: release
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
attestations: write
contents: read
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: "3.11"
- name: Build wheels
run: |
git clean -fxd
pip install -U build twine wheel
python -m build --sdist --wheel
- name: Verify the distribution
run: twine check --strict dist/*
- name: Generate artifact attestation for sdist and wheel
uses: actions/attest-build-provenance@173725a1209d09b31f9d30a3890cf2757ebbff0d # v1.1.2
with:
subject-path: "dist/networkx-*"
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1