-
Notifications
You must be signed in to change notification settings - Fork 11
146 lines (137 loc) Β· 4.58 KB
/
Copy pathpythonPublish.yml
File metadata and controls
146 lines (137 loc) Β· 4.58 KB
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: Build & Upload G2S to PyPI
on:
workflow_dispatch:
jobs:
build-sdist:
name: π¦ Source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.14"
- run: |
pip install --upgrade pip build twine
cd build
make python-sdist
cd python-build
twine upload --repository pypi dist/*.tar.gz --skip-existing --verbose
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
build-linux:
name: π§ Linux wheels (manylinux)
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
fail-fast: false
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python }}
- name: Build inside manylinux
run: |
PYVER=$(echo ${{ matrix.python }} | tr -d .)
PYTAG="cp${PYVER}-cp${PYVER}"
echo "π§± Building for $PYTAG using manylinux_2_28"
docker run --rm -v $PWD:/io quay.io/pypa/manylinux_2_28_x86_64 bash -c "
set -e
echo 'π Installing build dependencies...'
/opt/python/${PYTAG}/bin/python -m pip install --upgrade pip build wheel numpy pyzmq twine auditwheel
echo 'ποΈ Building wheel...'
cd /io/build
make PYTHON=/opt/python/${PYTAG}/bin/python python-wheel
echo 'π§© Running auditwheel repair...'
cd /io/build/python-build/dist
auditwheel repair *.whl -w .
rm -f *linux_x86_64.whl
echo 'β
Listing final wheels:'
ls -lh
"
- name: Test import
run: |
pip install build/python-build/dist/*.whl
python -c "import g2s; print('β
g2s import OK')"
- name: Upload to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
cd build/python-build
python -m pip install --upgrade twine
twine upload --repository pypi dist/*.whl --skip-existing --verbose
build-macos:
name: π macOS wheels
runs-on: macos-latest
strategy:
matrix:
python: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
fail-fast: false
env:
ARCHFLAGS: -arch arm64
MACOSX_DEPLOYMENT_TARGET: "11.0"
_PYTHON_HOST_PLATFORM: macosx-11.0-arm64
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
pip install --upgrade pip build wheel numpy pyzmq twine
- name: Build wheel
run: |
cd build
make python-wheel
- name: Test import
run: |
pip install build/python-build/dist/*.whl
python -c "import g2s; print('β
g2s import OK')"
- name: Upload to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
cd build/python-build
twine upload --repository pypi dist/*.whl --skip-existing --verbose
build-windows:
name: πͺ Windows wheels
runs-on: windows-latest
strategy:
matrix:
python: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
fail-fast: false
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip build wheel numpy pyzmq twine
- name: Install Windows dependencies
run: |
cd build/python-build
cmd.exe /c setup_Win_compile_all.bat
- name: Install GNU Make
run: choco install make --no-progress -y
- name: Build wheel
shell: bash
run: |
make -C build/python-build PYTHON=python wheel
- name: Test import
shell: pwsh
run: |
$wheel = Get-ChildItem build/python-build/dist/*.whl | Select-Object -First 1
Write-Host "Installing wheel: $($wheel.FullName)"
pip install "$($wheel.FullName)"
python -c "import g2s; print('g2s import OK')"
- name: Upload to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
cd build/python-build
twine upload --repository pypi dist/*.whl --skip-existing --verbose