|
9 | 9 | - published |
10 | 10 |
|
11 | 11 | jobs: |
| 12 | + build_sdist: |
| 13 | + name: Build source distribution |
| 14 | + runs-on: ubuntu-latest |
| 15 | + steps: |
| 16 | + - uses: actions/checkout@v4 |
| 17 | + with: |
| 18 | + submodules: 'true' |
| 19 | + |
| 20 | + - uses: actions/setup-python@v4 |
| 21 | + with: |
| 22 | + python-version: "3.12" |
| 23 | + |
| 24 | + - name: Install dependencies |
| 25 | + run: | |
| 26 | + python -m pip install --upgrade pip |
| 27 | + pip install Cython==3.0.7 |
| 28 | +
|
| 29 | + # The cythonized files allow installation from the sdist without cython |
| 30 | + - name: Generate cython |
| 31 | + run: | |
| 32 | + chmod +x ./src/cython/generate.sh |
| 33 | + ./src/cython/generate.sh |
| 34 | +
|
| 35 | + - name: Build sdist |
| 36 | + run: | |
| 37 | + pip3 install build; python3 -m build --sdist |
| 38 | + # test whether tarball contains all files required for compiling |
| 39 | + pip3 install dist/cydifflib-*.tar.gz |
| 40 | + pip3 uninstall cydifflib --yes |
| 41 | +
|
| 42 | + - uses: actions/upload-artifact@v3 |
| 43 | + with: |
| 44 | + path: dist/*.tar.gz |
| 45 | + |
12 | 46 | build_wheels_windows: |
13 | 47 | name: Build wheel on ${{ matrix.os }}/auto/${{matrix.python_tag}} |
| 48 | + needs: [build_sdist] |
14 | 49 | runs-on: windows-latest |
15 | 50 | strategy: |
16 | 51 | fail-fast: false |
17 | 52 | matrix: |
18 | | - arch: [auto32, auto64] |
19 | | - python_tag: ["cp36-*", "cp37-*", "cp38-*", "cp39-*", "cp310-*", "pp37-*", "pp38-*"] |
| 53 | + arch: [auto32, auto64, ARM64] |
| 54 | + python_tag: ["cp38-*", "cp39-*", "cp310-*", "cp311-*", "cp312-*", "pp38-*", "pp39-*"] |
20 | 55 | exclude: |
21 | 56 | # PyPy only supports x86_64 on Windows |
22 | 57 | - arch: auto32 |
23 | | - python_tag: "pp37-*" |
| 58 | + python_tag: "pp39-*" |
24 | 59 | - arch: auto32 |
25 | | - python_tag: "pp38-*" |
| 60 | + python_tag: "pp39-*" |
26 | 61 |
|
27 | | - # PyPy Windows is currently broken in scikit-build |
28 | | - - arch: auto64 |
29 | | - python_tag: "pp37-*" |
30 | | - - arch: auto64 |
| 62 | + # ARM64 only supported only supported on cpython >= 3.9 |
| 63 | + - arch: ARM64 |
31 | 64 | python_tag: "pp38-*" |
| 65 | + - arch: ARM64 |
| 66 | + python_tag: "pp39-*" |
| 67 | + - arch: ARM64 |
| 68 | + python_tag: "cp38-*" |
32 | 69 | env: |
33 | 70 | CIBW_BUILD: ${{matrix.python_tag}} |
34 | 71 | CIBW_ARCHS: ${{matrix.arch}} |
| 72 | + CIBW_TEST_SKIP: "*-win32" |
35 | 73 | CIBW_TEST_REQUIRES: pytest |
36 | 74 | CIBW_TEST_COMMAND: pytest {package}/tests |
37 | 75 | CIBW_BUILD_VERBOSITY: 3 |
38 | 76 |
|
39 | 77 | steps: |
40 | | - - uses: actions/checkout@v2 |
| 78 | + - uses: actions/download-artifact@v3 |
41 | 79 | with: |
42 | | - submodules: 'true' |
| 80 | + name: artifact |
| 81 | + path: dist |
43 | 82 |
|
44 | | - - uses: actions/setup-python@v2 |
| 83 | + - name: Copy wheel |
| 84 | + run: copy dist/*.tar.gz cydifflib.tar.gz |
| 85 | + |
| 86 | + - uses: actions/setup-python@v4 |
45 | 87 |
|
46 | 88 | - name: Build wheels |
47 | | - uses: pypa/cibuildwheel@v2.3.1 |
| 89 | + uses: pypa/cibuildwheel@v2.15.0 |
48 | 90 | with: |
| 91 | + package-dir: cydifflib.tar.gz |
49 | 92 | output-dir: wheelhouse |
50 | 93 |
|
51 | 94 | - name: Upload wheels |
52 | | - uses: actions/upload-artifact@v2 |
| 95 | + uses: actions/upload-artifact@v3 |
53 | 96 | with: |
54 | 97 | path: ./wheelhouse/*.whl |
55 | 98 |
|
56 | 99 | build_wheels_macos: |
57 | 100 | name: Build wheel on ${{ matrix.os }}/auto/${{matrix.python_tag}} |
| 101 | + needs: [build_sdist] |
58 | 102 | runs-on: macos-latest |
59 | 103 | strategy: |
60 | 104 | fail-fast: false |
61 | 105 | matrix: |
62 | 106 | arch: [x86_64, arm64, universal2] |
63 | | - python_tag: ["cp36-*", "cp37-*", "cp38-*", "cp39-*", "cp310-*"] |
| 107 | + python_tag: ["cp38-*", "cp39-*", "cp310-*", "cp311-*", "cp312-*", "pp38-*", "pp39-*"] |
64 | 108 | exclude: |
65 | | - # MacOS Arm only supported since Python 3.8 |
| 109 | + # PyPy not supported on MacOS Arm |
66 | 110 | - arch: arm64 |
67 | | - python_tag: "cp36-*" |
| 111 | + python_tag: "pp38-*" |
68 | 112 | - arch: arm64 |
69 | | - python_tag: "cp37-*" |
| 113 | + python_tag: "pp39-*" |
70 | 114 | - arch: universal2 |
71 | | - python_tag: "cp36-*" |
| 115 | + python_tag: "pp38-*" |
72 | 116 | - arch: universal2 |
73 | | - python_tag: "cp37-*" |
| 117 | + python_tag: "pp39-*" |
74 | 118 | env: |
75 | 119 | CIBW_BUILD: ${{matrix.python_tag}} |
76 | 120 | CIBW_ARCHS: ${{matrix.arch}} |
| 121 | + CIBW_TEST_SKIP: "{*-macosx_{arm64,universal2},pp*-macosx_*}" |
77 | 122 | CIBW_TEST_REQUIRES: pytest |
78 | 123 | CIBW_TEST_COMMAND: pytest {package}/tests |
79 | 124 | CIBW_BUILD_VERBOSITY: 3 |
80 | 125 |
|
81 | 126 | steps: |
82 | | - - uses: actions/checkout@v2 |
| 127 | + - uses: actions/download-artifact@v3 |
83 | 128 | with: |
84 | | - submodules: 'true' |
| 129 | + name: artifact |
| 130 | + path: dist |
85 | 131 |
|
86 | | - - uses: actions/setup-python@v2 |
| 132 | + - uses: actions/setup-python@v4 |
| 133 | + |
| 134 | + - name: Copy wheel |
| 135 | + run: cp dist/*.tar.gz cydifflib.tar.gz |
87 | 136 |
|
88 | 137 | - name: Build wheels |
89 | | - uses: pypa/cibuildwheel@v2.3.1 |
| 138 | + uses: pypa/cibuildwheel@v2.15.0 |
90 | 139 | with: |
| 140 | + package-dir: cydifflib.tar.gz |
91 | 141 | output-dir: wheelhouse |
92 | 142 |
|
93 | 143 | - name: Upload wheels |
94 | | - uses: actions/upload-artifact@v2 |
| 144 | + uses: actions/upload-artifact@v3 |
95 | 145 | with: |
96 | 146 | path: ./wheelhouse/*.whl |
97 | 147 |
|
98 | 148 | build_wheels_linux: |
99 | 149 | name: Build wheels on ubuntu-latest/${{matrix.arch}}/${{matrix.python_tag}} |
| 150 | + needs: [build_sdist] |
100 | 151 | runs-on: ubuntu-latest |
101 | 152 | strategy: |
102 | 153 | fail-fast: false |
103 | 154 | matrix: |
104 | | - # disable s390x and ppc64le wheels while they are not provided by numpy |
105 | | - # arch: [auto, aarch64, ppc64le, s390x] |
106 | | - arch: [auto, aarch64] |
107 | | - python_tag: [ "cp36-*", "cp37-*", "cp38-*", "cp39-*", "cp310-*", "pp37-*", "pp38-*"] |
| 155 | + arch: [auto, aarch64, ppc64le, s390x] |
| 156 | + python_tag: ["cp38-*", "cp39-*", "cp310-*", "cp311-*", "cp312-*", "pp38-*", "pp39-*"] |
| 157 | + exclude: |
| 158 | + # PyPy builds not available for these platforms |
| 159 | + - arch: ppc64le |
| 160 | + python_tag: "pp38-*" |
| 161 | + - arch: ppc64le |
| 162 | + python_tag: "pp39-*" |
| 163 | + - arch: s390x |
| 164 | + python_tag: "pp38-*" |
| 165 | + - arch: s390x |
| 166 | + python_tag: "pp39-*" |
108 | 167 | env: |
109 | 168 | CIBW_ARCHS_LINUX: ${{matrix.arch}} |
110 | 169 | CIBW_BUILD: ${{matrix.python_tag}} |
111 | | - CIBW_SKIP: "*musllinux_*" |
112 | | - CIBW_TEST_SKIP: "*-manylinux_{aarch64,ppc64le,s390x}" |
| 170 | + CIBW_TEST_SKIP: "{*_{aarch64,ppc64le,s390x},*musllinux_*,pp38-*}" |
113 | 171 | CIBW_TEST_REQUIRES: pytest |
114 | 172 | CIBW_TEST_COMMAND: pytest {package}/tests |
115 | 173 | CIBW_BUILD_VERBOSITY: 3 |
116 | 174 |
|
117 | 175 | steps: |
118 | | - - uses: actions/checkout@v2 |
| 176 | + - uses: actions/download-artifact@v3 |
119 | 177 | with: |
120 | | - submodules: 'true' |
| 178 | + name: artifact |
| 179 | + path: dist |
| 180 | + |
| 181 | + - uses: actions/setup-python@v4 |
121 | 182 |
|
122 | | - - uses: actions/setup-python@v2 |
| 183 | + - name: Copy wheel |
| 184 | + run: cp dist/*.tar.gz cydifflib.tar.gz |
123 | 185 |
|
124 | | - - uses: docker/setup-qemu-action@v1 |
| 186 | + - uses: docker/setup-qemu-action@v2 |
125 | 187 | name: Set up QEMU |
126 | 188 |
|
127 | 189 | - name: Build wheel |
128 | | - uses: pypa/cibuildwheel@v2.3.1 |
| 190 | + uses: pypa/cibuildwheel@v2.15.0 |
129 | 191 | with: |
| 192 | + package-dir: cydifflib.tar.gz |
130 | 193 | output-dir: wheelhouse |
131 | 194 |
|
132 | 195 | - name: Upload wheels |
133 | | - uses: actions/upload-artifact@v2 |
| 196 | + uses: actions/upload-artifact@v3 |
134 | 197 | with: |
135 | 198 | path: ./wheelhouse/*.whl |
136 | 199 |
|
137 | | - build_sdist: |
138 | | - name: Build source distribution |
139 | | - runs-on: ubuntu-latest |
140 | | - steps: |
141 | | - - uses: actions/checkout@v2 |
142 | | - with: |
143 | | - submodules: 'true' |
144 | | - |
145 | | - - uses: actions/setup-python@v2 |
146 | | - |
147 | | - - name: Install dependencies |
148 | | - run: | |
149 | | - python -m pip install --upgrade pip |
150 | | - pip install Cython==3.0.0b02 |
151 | | -
|
152 | | - # The cythonized files allow installation from the sdist without cython |
153 | | - - name: Generate cython |
154 | | - run: | |
155 | | - chmod +x ./src/cython/generate.sh |
156 | | - ./src/cython/generate.sh |
157 | | -
|
158 | | - - name: Build sdist |
159 | | - run: | |
160 | | - pip3 install build; python3 -m build --sdist |
161 | | - # test whether tarball contains all files required for compiling |
162 | | - pip3 install dist/cydifflib-*.tar.gz |
163 | | - pip3 uninstall cydifflib --yes |
164 | | -
|
165 | | - - uses: actions/upload-artifact@v2 |
166 | | - with: |
167 | | - path: dist/*.tar.gz |
168 | | - |
169 | 200 | deploy-wheels: |
170 | 201 | if: github.event_name == 'release' && github.event.action == 'published' |
171 | 202 | needs: [build_wheels_windows, build_wheels_macos, build_wheels_linux, build_sdist] |
172 | 203 | name: deploy wheels to pypi |
173 | | - runs-on: ubuntu-18.04 |
| 204 | + runs-on: ubuntu-latest |
| 205 | + environment: pypi-release |
| 206 | + permissions: |
| 207 | + id-token: write |
174 | 208 |
|
175 | 209 | steps: |
176 | | - - uses: actions/download-artifact@v2 |
| 210 | + - uses: actions/download-artifact@v3 |
177 | 211 | with: |
178 | 212 | name: artifact |
179 | 213 | path: dist |
180 | 214 |
|
181 | | - - uses: pypa/gh-action-pypi-publish@master |
182 | | - with: |
183 | | - user: __token__ |
184 | | - password: ${{ secrets.pypi_password }} |
| 215 | + |
0 commit comments