11name : release-main
22
33on :
4+ workflow_dispatch :
45 release :
56 types : [published]
67 branches : [main]
78
89jobs :
9- publish :
10+ build :
1011 strategy :
11- matrix : # python-version: ["3.9", "3.10", "3.11", "3.12"]
12+ matrix :
13+ # python-version: ["3.9", "3.10", "3.11", "3.12"]
1214 python-version : ["3.11", "3.12"]
1315 # os: [macos-13, windows-latest, ubuntu-latest, macos-14]
1416 os : [ubuntu-latest, macos-14]
1719 defaults :
1820 run :
1921 shell : bash
22+
2023 steps :
2124 - name : Check out
2225 uses : actions/checkout@v4
2528 fetch-depth : 2
2629
2730
28- - uses : actions/setup-python@v5
31+ - name : Set up Python
32+ uses : actions/setup-python@v5
2933 with :
3034 python-version : ${{ matrix.python-version }}
3135
@@ -42,12 +46,12 @@ jobs:
4246 native-image-job-reports : " true"
4347 cache : " maven"
4448
45- - name : build entire project
49+ - name : build VCell Java project from submodule
4650 working-directory : vcell_submodule
4751 run : |
4852 mvn --batch-mode clean install dependency:copy-dependencies -DskipTests=true
4953
50- - name : test, record, and build/install native library (ubuntu)
54+ - name : test, record, and build/install native library (ubuntu or macos )
5155 working-directory : vcell-native
5256 run : |
5357 mvn --batch-mode clean install
5862 "target/sbml-input"
5963
6064 mvn --batch-mode -P shared-dll package
61- cp target/libvcell.so ../libvcell/_internal/libs
62- if : ${{ startsWith(matrix.os, 'ubuntu') }}
63-
64- - name : test, record, and build/install native library (macos)
65- working-directory : vcell-native
66- run : |
67- mvn --batch-mode clean install
68-
69- java -agentlib:native-image-agent=config-output-dir=target/recording \
70- -jar target/vcell-native-1.0-SNAPSHOT.jar \
71- "src/test/resources/TinySpacialProject_Application0.xml" \
72- "target/sbml-input"
73-
74- mvn --batch-mode -P shared-dll package
75- cp target/libvcell.dylib ../libvcell/_internal/libs
76- if : ${{ startsWith(matrix.os, 'macos') }}
65+ cp target/libvcell.so ../libvcell/lib || true
66+ cp target/libvcell.dylib ../libvcell/lib || true
67+ if : ${{ startsWith(matrix.os, 'ubuntu') || startsWith(matrix.os, 'macos') }}
7768
7869 - name : test, record, and build/install native library (windows)
7970 working-directory : vcell-native
8374 java -agentlib:native-image-agent=config-output-dir=target\recording -jar "target\vcell-native-1.0-SNAPSHOT.jar" "src\test\resources\TinySpacialProject_Application0.xml" "target\sbml-input"
8475
8576 mvn --batch-mode -P shared-dll package
86- cp target/libvcell.dll ../libvcell/_internal/libs
77+ cp target/libvcell.dll ../libvcell/lib
8778 if : ${{ startsWith(matrix.os, 'windows') }}
8879
8980 - name : Install python dependencies
@@ -96,14 +87,33 @@ jobs:
9687 id : vars
9788 run : echo tag=${GITHUB_REF#refs/*/} >> $GITHUB_OUTPUT
9889
99- - name : Build and publish
90+ - name : Build wheels
10091 run : |
101- source .venv/bin/activate
102- poetry version $RELEASE_VERSION
103- make build-and-publish
104- env :
105- PYPI_TOKEN : ${{ secrets.PYPI_TOKEN }}
106- RELEASE_VERSION : ${{ steps.vars.outputs.tag }}
92+ pip install cibuildwheel
93+ cibuildwheel --output-dir wheelhouse
94+
95+ - name : Upload wheels as artifacts
96+ uses : actions/upload-artifact@v4
97+ with :
98+ name : wheels
99+ path : wheelhouse/*.whl
100+
101+ publish :
102+ needs : build
103+ runs-on : ubuntu-latest
104+ steps :
105+ - name : Download wheels
106+ uses : actions/download-artifact@v4
107+ with :
108+ name : wheels
109+ path : wheelhouse
110+
111+ - name : Publish to PyPI
112+ 113+ with :
114+ password : ${{ secrets.PYPI_TOKEN }}
115+ packages_dir : wheelhouse
116+
107117 deploy-docs :
108118 needs : publish
109119 runs-on : ubuntu-latest
0 commit comments