File: release.yml

package info (click to toggle)
networkx 3.4.2-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,700 kB
  • sloc: python: 105,310; xml: 544; makefile: 131; javascript: 120; sh: 34
file content (44 lines) | stat: -rw-r--r-- 1,308 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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