Skip to content

Commit 02b8b00

Browse files
committed
- create an experimental source archive
1 parent 02a5ff9 commit 02b8b00

File tree

1 file changed

+45
-14
lines changed

1 file changed

+45
-14
lines changed

.github/workflows/experimental_wheels.yml

Lines changed: 45 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ on:
44
workflow_dispatch:
55

66

7-
env:
8-
LIBSBML_EXPERIMENTAL: 1
9-
10-
117
jobs:
128
make_sdist:
139
name: Make SDist
@@ -23,12 +19,18 @@ jobs:
2319
./.github/workflows/checkout-submodules.sh
2420
2521
- name: Build SDist
26-
run: pipx run build --sdist
22+
run: |
23+
# prepend the experimental flag to the environment at the start of setup.py
24+
# by adding import os; os.environ["LIBSBML_EXPERIMENTAL"] = "1" to the beginning of setup.py
25+
sed -i '1i import os; os.environ["LIBSBML_EXPERIMENTAL"] = "1"' setup.py
26+
27+
# build sdist
28+
pipx run build --sdist
2729
2830
- uses: actions/upload-artifact@v4
2931
with:
3032
path: dist/*.tar.gz
31-
name: sdist
33+
name: libSBML-sdist
3234

3335
build_wheels:
3436
name: Wheel on ${{ matrix.os }} for ${{ matrix.python_version }}
@@ -43,24 +45,53 @@ jobs:
4345
steps:
4446
- uses: actions/download-artifact@v4
4547
with:
46-
name: sdist
48+
name: libSBML-sdist
4749

4850
- name: Extract sdist into the current directory
4951
shell: bash
5052
run: |
5153
tar zxf *.tar.gz --strip-components=1
5254
53-
- name: install swig on macos
54-
if: matrix.os == 'macos-latest'
55-
run: brew install swig
55+
- name: Install cibuildwheel
56+
run: |
57+
python -m pip install cibuildwheel==2.23.2 swig==4.2.1 cmake==3.31.6
58+
59+
# print versions
60+
python --version
61+
cmake --version
62+
swig -version
5663

57-
- uses: pypa/[email protected]
64+
65+
- name: Build Wheels
66+
run: |
67+
python -m cibuildwheel --output-dir wheelhouse
5868
env:
5969
CIBW_BUILD: ${{ matrix.python_version }}
6070
CIBW_ARCHS_MACOS: x86_64 arm64
61-
CIBW_ENVIRONMENT: LIBSBML_EXPERIMENTAL=1
6271

6372
- name: Upload wheels
64-
uses: actions/upload-artifact@v3
73+
uses: actions/upload-artifact@v4
6574
with:
66-
path: wheelhouse/*.whl
75+
path: wheelhouse/*.whl
76+
name: libSBML-${{ matrix.os }}-${{ strategy.job-index }}
77+
78+
merge_wheels:
79+
needs: [build_wheels]
80+
runs-on: ubuntu-latest
81+
steps:
82+
- uses: actions/download-artifact@v4
83+
with:
84+
pattern: libSBML-*
85+
path: dist
86+
87+
- name: Move wheels from dist subfolder to dist folder
88+
run: |
89+
find dist -name "*.whl" -exec mv {} dist/ \;
90+
find dist -name "*.tar.gz" -exec mv {} dist/ \;
91+
find dist -type d -empty -delete
92+
93+
- uses: actions/upload-artifact@v4
94+
with:
95+
name: libSBML-combined
96+
path: dist
97+

0 commit comments

Comments
 (0)