virtualshell 0.1.0__tar.gz → 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,338 @@
1
+ name: Build & Publish
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ target:
7
+ description: "Publish target repository"
8
+ required: true
9
+ default: "testpypi"
10
+ type: choice
11
+ options: ["testpypi", "pypi"]
12
+ push:
13
+ tags:
14
+ - "v*"
15
+
16
+ concurrency:
17
+ group: build-publish-${{ github.ref }}
18
+ cancel-in-progress: true
19
+
20
+ jobs:
21
+ wheels-linux-x86_64:
22
+ name: Wheels (Linux x86_64)
23
+ runs-on: ubuntu-latest
24
+ strategy:
25
+ fail-fast: false
26
+ matrix:
27
+ include:
28
+ - python: "cp38-*"
29
+ label: "cp38"
30
+ - python: "cp39-*"
31
+ label: "cp39"
32
+ - python: "cp310-*"
33
+ label: "cp310"
34
+ - python: "cp311-*"
35
+ label: "cp311"
36
+ - python: "cp312-*"
37
+ label: "cp312"
38
+ - python: "cp313-*"
39
+ label: "cp313"
40
+ steps:
41
+ - uses: actions/checkout@v4
42
+ with:
43
+ fetch-depth: 0
44
+
45
+ - name: Set up Python (host)
46
+ uses: actions/setup-python@v5
47
+ with:
48
+ python-version: "3.12"
49
+
50
+ - name: Install cibuildwheel
51
+ run: |
52
+ python -m pip install -U pip
53
+ python -m pip install cibuildwheel
54
+
55
+ - name: Build wheels with cibuildwheel (manylinux x86_64)
56
+ env:
57
+ CIBW_BUILD: ${{ matrix.python }}
58
+ CIBW_ARCHS_LINUX: "x86_64"
59
+ CIBW_SKIP: "*-musllinux_* *-manylinux_i686"
60
+ CIBW_TEST_COMMAND: python -c "import virtualshell; print('ok')"
61
+ CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
62
+
63
+ CMAKE_GENERATOR: Ninja
64
+ PYBIND11_FINDPYTHON: "ON"
65
+ CIBW_BEFORE_BUILD_LINUX: "python -m pip install ninja"
66
+ run: |
67
+ python -m cibuildwheel --platform linux --output-dir wheelhouse .
68
+
69
+ - name: Upload wheels (Linux x86_64)
70
+ uses: actions/upload-artifact@v4
71
+ with:
72
+ name: wheels-linux-x86_64-${{ matrix.label }}-attempt${{ github.run_attempt }}
73
+ path: wheelhouse/*.whl
74
+ overwrite: true
75
+
76
+ wheels-linux-aarch64:
77
+ name: Wheels (Linux aarch64)
78
+ runs-on: ubuntu-latest
79
+ strategy:
80
+ fail-fast: false
81
+ matrix:
82
+ include:
83
+ - python: "cp38-*"
84
+ label: "cp38"
85
+ - python: "cp39-*"
86
+ label: "cp39"
87
+ - python: "cp310-*"
88
+ label: "cp310"
89
+ - python: "cp311-*"
90
+ label: "cp311"
91
+ - python: "cp312-*"
92
+ label: "cp312"
93
+ - python: "cp313-*"
94
+ label: "cp313"
95
+ steps:
96
+ - uses: actions/checkout@v4
97
+ with:
98
+ fetch-depth: 0
99
+
100
+ - name: Set up QEMU for cross-arch Docker
101
+ uses: docker/setup-qemu-action@v3
102
+ with:
103
+ platforms: arm64
104
+
105
+ - name: Set up Python (host)
106
+ uses: actions/setup-python@v5
107
+ with:
108
+ python-version: "3.12"
109
+
110
+ - name: Install cibuildwheel
111
+ run: |
112
+ python -m pip install -U pip
113
+ python -m pip install cibuildwheel
114
+
115
+ - name: Build wheels with cibuildwheel (manylinux aarch64 via QEMU)
116
+ env:
117
+ CIBW_BUILD: ${{ matrix.python }}
118
+ CIBW_ARCHS_LINUX: "aarch64"
119
+ CIBW_SKIP: "*-musllinux_*"
120
+ CIBW_TEST_COMMAND: python -c "import virtualshell; print('ok')"
121
+ CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_28
122
+ CMAKE_GENERATOR: Ninja
123
+ PYBIND11_FINDPYTHON: "ON"
124
+ CIBW_BEFORE_BUILD_LINUX: "python -m pip install ninja"
125
+ run: |
126
+ python -m cibuildwheel --platform linux --output-dir wheelhouse .
127
+
128
+ - name: Upload wheels (Linux aarch64)
129
+ uses: actions/upload-artifact@v4
130
+ with:
131
+ name: wheels-linux-aarch64-${{ matrix.label }}-attempt${{ github.run_attempt }}
132
+ path: wheelhouse/*.whl
133
+ overwrite: true
134
+
135
+ wheels-macos:
136
+ name: Wheels (universal2 macOS)
137
+ runs-on: macos-latest
138
+ strategy:
139
+ fail-fast: false
140
+ matrix:
141
+ include:
142
+ - python: "cp38-*"
143
+ label: "cp38"
144
+ - python: "cp39-*"
145
+ label: "cp39"
146
+ - python: "cp310-*"
147
+ label: "cp310"
148
+ - python: "cp311-*"
149
+ label: "cp311"
150
+ - python: "cp312-*"
151
+ label: "cp312"
152
+ - python: "cp313-*"
153
+ label: "cp313"
154
+
155
+ steps:
156
+ - uses: actions/checkout@v4
157
+ with:
158
+ fetch-depth: 0
159
+
160
+ - name: Set up Python (host)
161
+ uses: actions/setup-python@v5
162
+ with:
163
+ python-version: "3.12"
164
+
165
+ - name: Install cibuildwheel
166
+ run: |
167
+ python -m pip install -U pip
168
+ python -m pip install cibuildwheel
169
+
170
+ - name: Build wheels with cibuildwheel (universal2)
171
+ env:
172
+ CIBW_BUILD: ${{ matrix.python }}
173
+ CIBW_ARCHS_MACOS: "universal2"
174
+ CIBW_MACOSX_DEPLOYMENT_TARGET: "11.0" # <- styrer wheel-tag + env
175
+ CIBW_TEST_COMMAND: python -c "import virtualshell; print('ok')"
176
+ CIBW_BUILD_VERBOSITY: "1"
177
+ CIBW_BEFORE_BUILD_MACOS: "python -m pip install ninja"
178
+
179
+ # ---- Tving CMake til universal2 via både CMAKE_ARGS og env ----
180
+ # skbuild-core leser CMAKE_ARGS direkte og sender videre til CMake.
181
+ CMAKE_ARGS: >-
182
+ -G Ninja
183
+ -DCMAKE_OSX_ARCHITECTURES=arm64;x86_64
184
+ -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0
185
+
186
+ # Disse brukes i tillegg (belt and suspenders)
187
+ PYBIND11_FINDPYTHON: "ON"
188
+ CMAKE_GENERATOR: "Ninja"
189
+ CMAKE_OSX_ARCHITECTURES: "arm64;x86_64"
190
+ CMAKE_OSX_DEPLOYMENT_TARGET: "11.0"
191
+ MACOSX_DEPLOYMENT_TARGET: "11.0" # påvirker clangs -mmacosx-version-min
192
+
193
+ run: |
194
+ python -m cibuildwheel --platform macos --output-dir wheelhouse .
195
+
196
+ - name: Upload wheels (macOS)
197
+ uses: actions/upload-artifact@v4
198
+ with:
199
+ name: wheels-macos-${{ matrix.label }}-attempt${{ github.run_attempt }}
200
+ path: wheelhouse/*.whl
201
+ overwrite: true
202
+
203
+ wheels-windows:
204
+ name: Wheels (Windows x64)
205
+ runs-on: windows-latest
206
+ strategy:
207
+ fail-fast: false
208
+ matrix:
209
+ python: ["cp38-win_amd64", "cp39-win_amd64", "cp310-win_amd64", "cp311-win_amd64", "cp312-win_amd64", "cp313-win_amd64"]
210
+ steps:
211
+ - uses: actions/checkout@v4
212
+ with:
213
+ fetch-depth: 0
214
+
215
+ - name: Set up Python (host)
216
+ uses: actions/setup-python@v5
217
+ with:
218
+ python-version: "3.12"
219
+
220
+ - name: Install cibuildwheel
221
+ run: |
222
+ py -3 -m pip install -U pip
223
+ py -3 -m pip install cibuildwheel
224
+
225
+ - name: Build wheels with cibuildwheel (MSVC)
226
+ env:
227
+ CIBW_BUILD: ${{ matrix.python }}
228
+ CIBW_SKIP: "*-win32"
229
+ CIBW_TEST_COMMAND: python -c "import virtualshell; print('ok')"
230
+ CIBW_ENVIRONMENT_WINDOWS: >
231
+ CMAKE_GENERATOR="Visual Studio 17 2022"
232
+ CMAKE_GENERATOR_PLATFORM="x64"
233
+ PYBIND11_FINDPYTHON=ON
234
+ run: |
235
+ py -3 -m cibuildwheel --output-dir wheelhouse .
236
+
237
+ - name: Upload wheels (Windows)
238
+ uses: actions/upload-artifact@v4
239
+ with:
240
+ name: wheels-windows-${{ matrix.python }}-attempt${{ github.run_attempt }}
241
+ path: wheelhouse\*.whl
242
+ overwrite: true
243
+
244
+ sdist:
245
+ name: sdist (source)
246
+ runs-on: ubuntu-latest
247
+ steps:
248
+ - uses: actions/checkout@v4
249
+ with:
250
+ fetch-depth: 0
251
+
252
+ - name: Set up Python
253
+ uses: actions/setup-python@v5
254
+ with:
255
+ python-version: "3.12"
256
+
257
+ - name: Build sdist
258
+ run: |
259
+ python -m pip install -U pip build twine
260
+ python -m build --sdist --outdir dist .
261
+ twine check dist/*
262
+
263
+ - name: Upload sdist
264
+ uses: actions/upload-artifact@v4
265
+ with:
266
+ name: sdist
267
+ path: dist/*.tar.gz
268
+
269
+ publish:
270
+ needs: [wheels-linux-x86_64, wheels-linux-aarch64, wheels-macos, wheels-windows, sdist]
271
+ runs-on: ubuntu-latest
272
+ if: github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/v')
273
+ permissions:
274
+ contents: read
275
+
276
+ steps:
277
+ - name: Download wheel artifacts
278
+ uses: actions/download-artifact@v4
279
+ with:
280
+ pattern: wheels-*
281
+ merge-multiple: true
282
+ path: dist_in
283
+
284
+ - name: Download sdist
285
+ uses: actions/download-artifact@v4
286
+ with:
287
+ name: sdist
288
+ path: dist_in
289
+
290
+ - name: Gather distributions
291
+ run: |
292
+ mkdir -p dist
293
+ find dist_in -type f \( -name "*.whl" -o -name "*.tar.gz" \) -exec cp {} dist/ \;
294
+ ls -l dist
295
+
296
+ - name: Ensure dists exist
297
+ run: |
298
+ shopt -s nullglob
299
+ files=(dist/*.whl dist/*.tar.gz)
300
+ if [ ${#files[@]} -eq 0 ]; then
301
+ echo "No distributions found to publish."
302
+ exit 1
303
+ fi
304
+
305
+ - name: Twine check
306
+ run: |
307
+ python -m pip install -U twine
308
+ python -m twine check dist/*
309
+
310
+ - name: Set publish target
311
+ id: target
312
+ run: |
313
+ if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
314
+ echo "repo=${{ inputs.target }}" >> $GITHUB_OUTPUT
315
+ else
316
+ echo "repo=pypi" >> $GITHUB_OUTPUT
317
+ fi
318
+
319
+ - name: Publish to TestPyPI (token)
320
+ if: steps.target.outputs.repo == 'testpypi'
321
+ uses: pypa/gh-action-pypi-publish@release/v1
322
+ with:
323
+ repository-url: https://test.pypi.org/legacy/
324
+ packages-dir: dist
325
+ skip-existing: true
326
+ verbose: true
327
+ user: __token__
328
+ password: ${{ secrets.TEST_PYPI_API_TOKEN }}
329
+
330
+ - name: Publish to PyPI (token)
331
+ if: steps.target.outputs.repo == 'pypi'
332
+ uses: pypa/gh-action-pypi-publish@release/v1
333
+ with:
334
+ packages-dir: dist
335
+ skip-existing: false
336
+ verbose: true
337
+ user: __token__
338
+ password: ${{ secrets.PYPI_API_TOKEN }}