File: publish.yml

package info (click to toggle)
cbor2 5.8.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 684 kB
  • sloc: ansic: 5,667; python: 3,995; makefile: 14; sh: 8
file content (92 lines) | stat: -rw-r--r-- 2,254 bytes parent folder | download | duplicates (2)
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
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:
  binary-wheels:
    strategy:
      matrix:
        os:
          - ubuntu-latest
          - ubuntu-24.04-arm
          - windows-latest
          - windows-11-arm
          - macos-latest
    runs-on: ${{ matrix.os }}
    environment: release
    steps:
    - uses: actions/checkout@v6
    - name: Build wheels
      uses: pypa/cibuildwheel@v3.3.0
      env:
        CBOR2_BUILD_C_EXTENSION: "1"
        CIBW_SKIP: "*t-*"
        CIBW_ARCHS: "auto64"
        CIBW_TEST_GROUPS: "test"
        CIBW_TEST_COMMAND: "python -m pytest {project}/tests"
    - uses: actions/upload-artifact@v6
      with:
        name: wheels-${{ matrix.os }}
        path: wheelhouse/*.whl

  sdist-purewheel:
    runs-on: ubuntu-latest
    environment: release
    steps:
    - uses: actions/checkout@v6
    - name: Set up Python
      uses: actions/setup-python@v6
      with:
        python-version: 3.x
    - name: Install dependencies
      run: pip install build
    - name: Create sdist and pure-Python wheel
      run: python -m build .
      env:
        CBOR2_BUILD_C_EXTENSION: "0"
    - uses: actions/upload-artifact@v6
      with:
        name: sdist
        path: dist/*

  publish:
    needs:
      - binary-wheels
      - sdist-purewheel
    runs-on: ubuntu-latest
    environment: release
    permissions:
      id-token: write
    steps:
    - name: Download generated packaging artifacts
      uses: actions/download-artifact@v7
    - name: Move the packages to dist/
      run: |
        mkdir dist
        mv */*.whl */*.tar.gz dist
    - name: Upload packages
      uses: pypa/gh-action-pypi-publish@release/v1

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