File: release.yml

package info (click to toggle)
pyproject-metadata 0.10.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 344 kB
  • sloc: python: 2,704; makefile: 5
file content (48 lines) | stat: -rw-r--r-- 1,160 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
45
46
47
48
name: Package

on:
  workflow_dispatch:
  pull_request:
  push:
    branches:
      - main
      - v*
  release:
    types:
      - published

jobs:
  # Always build & lint package.
  build-package:
    name: Build & verify
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v5
      - uses: hynek/build-and-inspect-python-package@v2

  # Upload to real PyPI on GitHub Releases.
  release-pypi:
    name: Publish to pypi.org
    environment: release
    runs-on: ubuntu-latest
    needs: build-package
    if: github.event_name == 'release' && github.event.action == 'published'
    permissions:
      id-token: write
      attestations: write

    steps:
      - name: Download packages built by build-and-inspect-python-package
        uses: actions/download-artifact@v6
        with:
          name: Packages
          path: dist

      - name: Generate artifact attestation for sdist and wheel
        uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3.0.0
        with:
          subject-path: "dist/pyproject*"

      - name: Upload package to PyPI
        uses: pypa/gh-action-pypi-publish@release/v1