1
+ name : Python Wheels
2
+
3
+ on : [push, pull_request]
4
+
5
+ jobs :
6
+ build-wheels :
7
+ runs-on : ${{ matrix.os }}
8
+ strategy :
9
+ matrix :
10
+ os : [macos-latest, windows-2019, ubuntu-latest]
11
+ name : Build CPython ${{ matrix.python-version }}-${{ matrix.os }}
12
+ steps :
13
+ - uses : actions/checkout@v2
14
+ - uses : pypa/cibuildwheel@v2.3.1
15
+ env :
16
+ CIBW_ARCHS_MACOS : x86_64 universal2
17
+ CIBW_TEST_SKIP : ' *universal2:arm64'
18
+ CIBW_BUILD : " cp36-macosx_x86_64 cp38-macosx_universal2 cp36-win* cp36-manylinux_{x86_64,i686}"
19
+ - uses : actions/upload-artifact@v2
20
+ with :
21
+ name : python_bsonjs-3.6-${{ matrix.os }}-wheel
22
+ path : ./wheelhouse/*.whl
23
+ if-no-files-found : error
24
+ test-non-linux-wheels :
25
+ needs : build-wheels
26
+ runs-on : ${{ matrix.os }}
27
+ strategy :
28
+ matrix :
29
+ os : [macos-latest, windows-2019]
30
+ python-version : [3.6, 3.7, 3.8, 3.9, "3.10"]
31
+ name : Test CPython ${{ matrix.python-version }}-${{ matrix.os }}
32
+ steps :
33
+ - name : Setup Python
34
+ uses : actions/setup-python@v2
35
+ with :
36
+ python-version : ${{ matrix.python-version }}
37
+ - name : Download a previously created wheel
38
+ uses : actions/download-artifact@v2
39
+ with :
40
+ name : python_bsonjs-3.6-${{ matrix.os }}-wheel
41
+ - name : Test wheel
42
+ shell : bash
43
+ run : |
44
+ python -m pip install -U pip
45
+ python -m pip install --no-index --find-links=./ python_bsonjs
46
+ python -m pip list | grep python-bsonjs
47
+ python -c "from bsonjs import dumps"
48
+ # Linux
49
+ test-manylinux-wheels :
50
+ runs-on : ${{ matrix.os }}
51
+ needs : build-wheels
52
+ strategy :
53
+ matrix :
54
+ os : [ubuntu-latest]
55
+ container : ['manylinux2014_i686', 'manylinux2014_x86_64']
56
+ python-version : ['cp36-cp36m', 'cp37-cp37m', 'cp38-cp38',
57
+ ' cp39-cp39' , 'cp310-cp310']
58
+ name : Test CPython ${{ matrix.python-version }}-${{ matrix.container }}
59
+ steps :
60
+ - name : Download a previously created wheel
61
+ uses : actions/download-artifact@v2
62
+ with :
63
+ name : python_bsonjs-3.6-${{ matrix.os }}-wheel
64
+ - name : Test wheel
65
+ run : |
66
+ docker run --rm --volume `pwd`:/python quay.io/pypa/${{ matrix.container }} /bin/bash -c "/opt/python/${{ matrix.python-version }}/bin/python -m pip install -U pip && /opt/python/${{ matrix.python-version }}/bin/python -m pip install --find-links=/python/ --no-index python_bsonjs && /opt/python/${{ matrix.python-version }}/bin/python -m pip list | grep python-bsonjs && /opt/python/${{ matrix.python-version }}/bin/python -c 'from bsonjs import dumps'"
67
+ make_sdist :
68
+ name : Make SDist
69
+ runs-on : ubuntu-latest
70
+ steps :
71
+ - uses : actions/checkout@v2
72
+ - name : Build SDist
73
+ run : python setup.py sdist --dist-dir=dist --formats=gztar
74
+ - uses : actions/upload-artifact@v2
75
+ with :
76
+ name : " sdist"
77
+ path : dist/*.tar.gz
78
+ collect-wheels :
79
+ runs-on : ubuntu-latest
80
+ needs : [build-wheels, make_sdist]
81
+ name : Download Wheels
82
+ steps :
83
+ - name : Download all workflow run artifacts
84
+ uses : actions/download-artifact@v2
85
+ - name : Flatten directory
86
+ run : |
87
+ find . -mindepth 2 -type f -exec mv {} . \;
88
+ find . -type d -empty -delete
89
+ - uses : actions/upload-artifact@v2
90
+ with :
91
+ name : all-dist
92
+ path : " ./*"
0 commit comments