File: wheel.yml

package info (click to toggle)
python-msgpack 1.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 460 kB
  • sloc: python: 2,041; ansic: 1,431; makefile: 190; sh: 36
file content (88 lines) | stat: -rw-r--r-- 2,492 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
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
name: Build sdist and Wheels
on:
  push:
    branches: [main]
  release:
    types:
      - published
  workflow_dispatch:

jobs:
  build_wheels:
    strategy:
      matrix:
        # macos-13 is for intel
        os: ["ubuntu-24.04", "ubuntu-24.04-arm", "windows-latest", "windows-11-arm", "macos-13", "macos-latest"]
    runs-on: ${{ matrix.os }}
    name: Build wheels on ${{ matrix.os }}

    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: "3.x"
          cache: "pip"
      - name: Cythonize
        shell: bash
        run: |
          pip install -r requirements.txt
          make cython

      - name: Build
        uses: pypa/cibuildwheel@v3.2.0
        env:
          CIBW_TEST_REQUIRES: "pytest"
          CIBW_TEST_COMMAND: "pytest {package}/test"
          CIBW_SKIP: "pp* cp38-* cp39-win_arm64 cp310-win_arm64"

      - name: Build sdist
        if: runner.os == 'Linux' && runner.arch == 'X64'
        run: |
          pip install build
          python -m build -s -o wheelhouse

      - name: Upload Wheels to artifact
        uses: actions/upload-artifact@v4
        with:
          name: wheels-${{ matrix.os }}
          path: wheelhouse

  # combine all wheels into one artifact
  combine_wheels:
    needs: [build_wheels]
    runs-on: ubuntu-latest
    steps:
      - uses: actions/download-artifact@v4
        with:
          # unpacks all CIBW artifacts into dist/
          pattern: wheels-*
          path: dist
          merge-multiple: true

      - name: Upload Wheels to artifact
        uses: actions/upload-artifact@v4
        with:
          name: wheels-all
          path: dist

  # https://github.com/pypa/cibuildwheel/blob/main/examples/github-deploy.yml
  upload_pypi:
    needs: [build_wheels]
    runs-on: ubuntu-latest
    environment: pypi
    permissions:
      id-token: write
    if: github.event_name == 'release' && github.event.action == 'published'
    # or, alternatively, upload to PyPI on every tag starting with 'v' (remove on: release above to use this)
    # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
    steps:
      - uses: actions/download-artifact@v4
        with:
          # unpacks all CIBW artifacts into dist/
          pattern: wheels-*
          path: dist
          merge-multiple: true

      - uses: pypa/gh-action-pypi-publish@release/v1
        #with:
        # To test: repository-url: https://test.pypi.org/legacy/