File: publish.yml

package info (click to toggle)
python-typeguard 4.4.4-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 544 kB
  • sloc: python: 6,271; makefile: 5
file content (59 lines) | stat: -rw-r--r-- 1,419 bytes parent folder | download | duplicates (3)
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
49
50
51
52
53
54
55
56
57
58
59
name: Publish packages to PyPI

on:
  push:
    tags:
      - "[0-9]+.[0-9]+.[0-9]+"
      - "[0-9]+.[0-9]+.[0-9]+.post[0-9]+"
      - "[0-9]+.[0-9]+.[0-9]+[a-b][0-9]+"
      - "[0-9]+.[0-9]+.[0-9]+rc[0-9]+"

jobs:
  build:
    name: Build the source tarball and the wheel
    runs-on: ubuntu-latest
    environment: release
    steps:
    - uses: actions/checkout@v4
    - name: Set up Python
      uses: actions/setup-python@v5
      with:
        python-version: 3.x
    - name: Install dependencies
      run: pip install build
    - name: Create packages
      run: python -m build
    - name: Archive packages
      uses: actions/upload-artifact@v4
      with:
        name: dist
        path: dist

  publish:
    name: Publish build artifacts to the PyPI
    needs: build
    runs-on: ubuntu-latest
    environment: release
    permissions:
      id-token: write
    steps:
    - name: Retrieve packages
      uses: actions/download-artifact@v4
    - name: Upload packages
      uses: pypa/gh-action-pypi-publish@release/v1

  release:
    name: Create a GitHub release
    needs: build
    runs-on: ubuntu-latest
    permissions:
      contents: write
    steps:
    - uses: actions/checkout@v4
    - id: changelog
      uses: agronholm/release-notes@v1
      with:
        path: docs/versionhistory.rst
    - uses: ncipollo/release-action@v1
      with:
        body: ${{ steps.changelog.outputs.changelog }}