@@ -19,16 +19,13 @@ jobs:
1919 defaults :
2020 run :
2121 working-directory : ./nrtest-swmm
22-
2322 steps :
2423 - name : Checkout repo
2524 uses : actions/checkout@v5
26-
2725 - name : Install Python
2826 uses : actions/setup-python@v5
2927 with :
30- python-version : ' 3.10'
31-
28+ python-version : " 3.10"
3229 - name : Build wheel
3330 run : |
3431 pip install wheel
@@ -39,22 +36,41 @@ jobs:
3936 with :
4037 name : nrtest-swmm-wheel
4138 path : nrtest-swmm/dist/*.whl
42-
39+
40+ build_sdist :
41+ name : Build source distribution
42+ runs-on : ubuntu-latest
43+ defaults :
44+ run :
45+ working-directory : ./swmm-toolkit
46+ steps :
47+ - name : Checkout repo
48+ uses : actions/checkout@v5
49+ - name : Install Python
50+ uses : actions/setup-python@v5
51+ with :
52+ python-version : " 3.12"
53+ - name : Build sdist
54+ run : |
55+ pip install build
56+ python -m build --sdist --outdir ./dist
57+ - name : Upload sdist artifact
58+ uses : actions/upload-artifact@v4
59+ with :
60+ name : swmm-toolkit-sdist
61+ path : swmm-toolkit/dist/*.tar.gz
4362
4463 build_wheels :
4564 runs-on : ${{ matrix.os }}
4665 strategy :
4766 fail-fast : false
4867 matrix :
49- os : [ubuntu-latest, windows-latest, macos-latest]
50- pyver : [cp39, cp310, cp311, cp312, cp313]
51-
68+ os : [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-13, macos-latest]
5269 steps :
5370 - name : Checkout repo
54- uses : actions/checkout@v3
71+ uses : actions/checkout@v5
5572 with :
5673 submodules : true
57-
5874 - name : Build wheels
59756076 with :
@@ -63,65 +79,38 @@ jobs:
6379 MACOSX_DEPLOYMENT_TARGET : " 11.0"
6480 CIBW_TEST_COMMAND : " pytest {package}/tests"
6581 CIBW_BEFORE_TEST : pip install -r {package}/test-requirements.txt
66- # mac needs ninja to build
67- CIBW_BEFORE_BUILD_MACOS : brew install ninja
82+ CIBW_ENVIRONMENT_MACOS : |
83+ MACOSX_DEPLOYMENT_TARGET=11.0
6884 # remove system swig (cmake bug doesn't respect python venv)
6985 # https://github.com/swig/swig/issues/2481#issuecomment-1949573105
7086 CIBW_BEFORE_BUILD_LINUX : rm -f $(which swig) && rm -f $(which swig4.0)
71- # configure cibuildwheel to build native archs ('auto'), and some emulated ones
72- CIBW_ARCHS_LINUX : x86_64
73- CIBW_ARCHS_WINDOWS : AMD64
74- CIBW_ARCHS_MACOS : x86_64 arm64
75- # only build current supported python: https://devguide.python.org/versions/
76- # don't build pypy or musllinux to save build time. TODO: find a good way to support those archs
77- CIBW_BUILD : ${{matrix.pyver}}-*
78- CIBW_SKIP : cp38-* pp* *-musllinux*
79- # Will avoid testing on emulated architectures
80- # Skip trying to test arm64 builds on Intel Macs
81- CIBW_TEST_SKIP : " *-*linux_{aarch64,ppc64le,s390x} *-macosx_universal2:arm64"
87+ # skip 3.8 and any free threaded variants
88+ CIBW_SKIP : cp38-* cp3??t-*
89+ CIBW_ARCHS : native
8290 CIBW_BUILD_VERBOSITY : 1
83-
8491 - uses : actions/upload-artifact@v4
8592 with :
86- name : wheels-${{ matrix.os }}- ${{ matrix.pyver }}
93+ name : swmm-toolkit-bdist- ${{ matrix.os }}
8794 path : ./wheelhouse/*.whl
8895
89- build_cross_wheels :
96+ merge_wheels :
97+ name : Consolidate all wheel artifacts
9098 runs-on : ubuntu-latest
91- strategy :
92- fail-fast : false
93- matrix :
94- pyver : [cp39, cp310, cp311, cp312, cp313]
95-
99+ needs :
100+ - build_wheels
101+ - build_sdist
96102 steps :
97- - name : Checkout repo
98- uses : actions/checkout @v5
103+ - name : Download all distribution artifacts
104+ uses : actions/download-artifact @v5
99105 with :
100- submodules : true
101-
102- - name : Set up QEMU
103- if : runner.os == 'Linux'
104- uses : docker/setup-qemu-action@v2
105- with :
106- platforms : all
107-
108- - name : Build wheels
109- 106+ path : dist
107+ pattern : swmm-toolkit-*dist*
108+ merge-multiple : true
109+
110+ - name : Upload consolidated archive
111+ uses : actions/upload-artifact@v4
110112 with :
111- package-dir : ./swmm-toolkit
112- env :
113- # remove system swig (cmake bug doesn't respect python venv)
114- # https://github.com/swig/swig/issues/2481#issuecomment-1949573105
115- CIBW_BEFORE_BUILD_LINUX : rm -f $(which swig) && rm -f $(which swig4.0)
116- # configure cibuildwheel to build native archs ('auto'), and some emulated ones
117- CIBW_ARCHS_LINUX : aarch64
118- # only build current supported python: https://devguide.python.org/versions/
119- # don't build pypy or musllinux to save build time. TODO: find a good way to support those archs
120- CIBW_BUILD : ${{matrix.pyver}}-*
121- CIBW_SKIP : cp-*38 pp* *-musllinux*
122- CIBW_BUILD_VERBOSITY : 1
113+ name : swmm_toolkit_dist
114+ path : ./dist/*
123115
124- - uses : actions/upload-artifact@v4
125- with :
126- name : wheels-linux-aarch64-${{ matrix.pyver }}
127- path : ./wheelhouse/*.whl
116+
0 commit comments