-
Notifications
You must be signed in to change notification settings - Fork 97
92 lines (71 loc) · 2.32 KB
/
build-pypi.yml
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
name: Build & Publish pypi
on: workflow_dispatch
jobs:
build_binary_native:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
pyver: [cp39, cp310, cp311, cp312, cp313]
steps:
- uses: actions/checkout@v4
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BUILD: ${{ matrix.pyver }}-*
CIBW_BEFORE_BUILD: python -c "import shutil ; shutil.copyfile('tools/setup-pypi.cfg','setup.apsw')"
CIBW_TEST_COMMAND: python -m apsw.tests -v
APSW_HEAVY_DURATION: 2
- uses: actions/upload-artifact@v4
with:
name: dist-${{ matrix.os }}-${{ matrix.pyver }}
path: ./wheelhouse/*.whl
build_binary_qemu:
runs-on: ubuntu-latest
strategy:
matrix:
arch: [aarch64]
pyver: [cp39, cp310, cp311, cp312, cp313]
libc: [manylinux, musllinux]
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BUILD: ${{ matrix.pyver }}-${{ matrix.libc }}*
CIBW_ARCHS_LINUX: ${{ matrix.arch }}
CIBW_BEFORE_BUILD: python -c "import shutil ; shutil.copyfile('tools/setup-pypi.cfg','setup.apsw')"
CIBW_TEST_COMMAND: python -m apsw.tests -v
APSW_HEAVY_DURATION: 2
- uses: actions/upload-artifact@v4
with:
name: dist-qemu-${{ matrix.arch }}-${{ matrix.pyver }}-${{ matrix.libc }}
path: ./wheelhouse/*.whl
build_source:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Create source dist
run: python setup.py sdist --for-pypi
- uses: actions/upload-artifact@v4
with:
name: dist-source
path: ./dist/*
pypi_publish:
needs: [build_source, build_binary_native, build_binary_qemu]
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Stage wheels
uses: actions/download-artifact@v4
with:
pattern: dist-*
merge-multiple: true
path: dist
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1