44 release :
55 types :
66 - published
7+ workflow_dispatch :
8+ inputs :
9+ run_full_matrix :
10+ description : Build all additional architectures (aarch64, universal2, etc.)
11+ type : boolean
12+ default : true
713
814concurrency :
915 group : ${{ github.workflow }}-${{ github.ref }}
@@ -126,13 +132,41 @@ jobs:
126132 cache-dependency-path : ' **/requirements.dev.txt'
127133 - run : pip install -r python/requirements.dev.txt
128134 - run : maturin build -m python/Cargo.toml
129- - run : pip install --no-index --find-links=target/wheels/ pyontoenv
135+ - run : pip install --no-index --find-links=target/wheels/ ontoenv
130136 - run : rm -r target/wheels
131137 - run : maturin sdist -m python/Cargo.toml
132138 - uses : actions/upload-artifact@v4
133139 with :
134- name : pyontoenv_dist
140+ name : ontoenv_dist
135141 path : target/wheels/*.tar.gz
142+ python_pyontoenv_alias :
143+ runs-on : ubuntu-latest
144+ if : github.event_name == 'release' || github.event_name == 'workflow_dispatch'
145+ steps :
146+ - uses : actions/checkout@v4
147+ with :
148+ submodules : true
149+ - uses : actions/setup-python@v5
150+ with :
151+ python-version : " 3.12"
152+ - run : |
153+ VERSION=$(awk '
154+ /^\[workspace.package\]/ { in_section=1; next }
155+ /^\[/ { if (in_section) exit; in_section=0 }
156+ in_section && $1 ~ /^version/ {
157+ gsub(/"/, "", $3);
158+ print $3;
159+ exit
160+ }
161+ ' Cargo.toml)
162+ echo "ONTOENV_VERSION=$VERSION" >> "$GITHUB_ENV"
163+ - run : pip install build
164+ - run : python -m build
165+ working-directory : ./pyontoenv-shim
166+ - uses : actions/upload-artifact@v4
167+ with :
168+ name : ontoenv_pyontoenv_alias
169+ path : pyontoenv-shim/dist/*
136170
137171 wheel_linux :
138172 runs-on : ubuntu-latest
@@ -147,16 +181,16 @@ jobs:
147181 - uses : docker/setup-qemu-action@v2
148182 with :
149183 platforms : linux/${{ matrix.architecture }}
150- if : github.event_name == 'release' && matrix.architecture != 'x86_64'
184+ if : ( github.event_name == 'release' || github.event_name == 'workflow_dispatch' && github.event.inputs.run_full_matrix == 'true') && matrix.architecture != 'x86_64'
151185 - uses : ./.github/actions/setup-rust
152186 with :
153187 version : stable
154- - run : sed ' s/%arch%/${{ matrix.architecture }}/g' .github/workflows/manylinux_build.sh | sed ' s/%for_each_version%/${{ github.event_name == 'release' || '' }}/g' > .github/workflows/manylinux_build_script.sh
155- - run : docker run -v "$(pwd)":/workdir --platform linux/${{ matrix.architecture }} quay.io/pypa/manylinux2014_ ${{ matrix.architecture }} /bin/bash /workdir/.github/workflows/manylinux_build_script.sh
156- if : github.event_name == 'release' || matrix.architecture == 'x86_64'
188+ - run : sed " s/%arch%/${{ matrix.architecture }}/g" .github/workflows/manylinux_build.sh | sed " s/%for_each_version%/${{ ( github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.run_full_matrix == 'true')) && 'true' || '' }}/g" > .github/workflows/manylinux_build_script.sh
189+ - run : docker run -v "$(pwd)":/workdir --platform linux/${{ matrix.architecture }} quay.io/pypa/manylinux_2_28_ ${{ matrix.architecture }} /bin/bash /workdir/.github/workflows/manylinux_build_script.sh
190+ if : github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.run_full_matrix == 'true') || matrix.architecture == 'x86_64'
157191 - uses : actions/upload-artifact@v4
158192 with :
159- name : pyontoenv_ ${{ matrix.architecture }}_linux_gnu
193+ name : ontoenv_ ${{ matrix.architecture }}_linux_gnu
160194 path : target/wheels/*.whl
161195
162196 wheel_linux_musl :
@@ -172,17 +206,17 @@ jobs:
172206 - uses : docker/setup-qemu-action@v2
173207 with :
174208 platforms : linux/${{ matrix.architecture }}
175- if : github.event_name == 'release' && matrix.architecture != 'x86_64'
209+ if : ( github.event_name == 'release' || github.event_name == 'workflow_dispatch' && github.event.inputs.run_full_matrix == 'true') && matrix.architecture != 'x86_64'
176210 - uses : ./.github/actions/setup-rust
177211 with :
178212 version : stable
179- - run : sed ' s/%arch%/${{ matrix.architecture }}/g' .github/workflows/musllinux_build.sh | sed ' s/%for_each_version%/${{ github.event_name == 'release' || '' }}/g' > .github/workflows/musllinux_build_script.sh
213+ - run : sed " s/%arch%/${{ matrix.architecture }}/g" .github/workflows/musllinux_build.sh | sed " s/%for_each_version%/${{ ( github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.run_full_matrix == 'true')) && 'true' || '' }}/g" > .github/workflows/musllinux_build_script.sh
180214 - run : docker run -v "$(pwd)":/workdir --platform linux/${{ matrix.architecture }} quay.io/pypa/musllinux_1_2_${{ matrix.architecture }} /bin/bash /workdir/.github/workflows/musllinux_build_script.sh
181- if : github.event_name == 'release' || matrix.architecture == 'x86_64'
215+ if : github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.run_full_matrix == 'true') || matrix.architecture == 'x86_64'
182216 - run : find .
183217 - uses : actions/upload-artifact@v4
184218 with :
185- name : pyontoenv_ ${{ matrix.architecture }}_linux_musl
219+ name : ontoenv_ ${{ matrix.architecture }}_linux_musl
186220 path : target/wheels/*.whl
187221
188222 wheel_mac :
@@ -211,19 +245,19 @@ jobs:
211245 - run : pip install -r python/requirements.dev.txt
212246 - run : maturin build --release --features abi3
213247 working-directory : ./python
214- - run : pip install --no-index --find-links=target/wheels/ pyontoenv
248+ - run : pip install --no-index --find-links=target/wheels/ ontoenv
215249 - run : rm -r target/wheels
216250 - run : maturin build --release --target universal2-apple-darwin --features abi3
217251 working-directory : ./python
218252 - run : maturin build --release --target x86_64-apple-darwin --features abi3
219253 working-directory : ./python
220- if : github.event_name == 'release'
254+ if : github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.run_full_matrix == 'true')
221255 - run : maturin build --release --target aarch64-apple-darwin --features abi3
222256 working-directory : ./python
223- if : github.event_name == 'release'
257+ if : github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.run_full_matrix == 'true')
224258 - uses : actions/upload-artifact@v4
225259 with :
226- name : pyontoenv_macos
260+ name : ontoenv_macos
227261 path : target/wheels/*.whl
228262
229263 wheel_windows :
@@ -244,32 +278,33 @@ jobs:
244278 - run : pip install -r python/requirements.dev.txt
245279 - run : maturin build --release --features abi3
246280 working-directory : ./python
247- - run : pip install --no-index --find-links=target/wheels/ pyontoenv
281+ - run : pip install --no-index --find-links=target/wheels/ ontoenv
248282 - run : rm -r target/wheels
249283 - run : maturin build --release -m python/Cargo.toml --features abi3
250284 - uses : actions/upload-artifact@v4
251285 with :
252- name : pyontoenv_windows
286+ name : ontoenv_windows
253287 path : target/wheels/*.whl
254288
255289 publish_pypi :
256290 if : github.event_name == 'release'
257291 runs-on : ubuntu-latest
258292 environment :
259293 name : publish
260- url : https://pypi.org/p/pyontoenv
294+ url : https://pypi.org/p/ontoenv
261295 permissions :
262296 id-token : write
263297 needs :
264298 - python_sdist
299+ - python_pyontoenv_alias
265300 - wheel_windows
266301 - wheel_mac
267302 - wheel_linux
268303 - wheel_linux_musl
269304 steps :
270305 - uses : actions/download-artifact@v4
271306 with :
272- pattern : pyontoenv_ *
307+ pattern : ontoenv_ *
273308 path : dist
274309 merge-multiple : true
275310 - uses : pypa/gh-action-pypi-publish@release/v1
@@ -301,15 +336,6 @@ jobs:
301336 registry-token : ${{ secrets.CARGO_REGISTRY_TOKEN }}
302337 env :
303338 CARGO_REGISTRY_TOKEN : ${{ secrets.CARGO_REGISTRY_TOKEN }}
304- - name : Wait for crate index propagation
305- run : sleep 45
306- - name : Publish pyontoenv crate
307- uses : katyo/publish-crates@v2
308- with :
309- path : ' ./python'
310- registry-token : ${{ secrets.CARGO_REGISTRY_TOKEN }}
311- env :
312- CARGO_REGISTRY_TOKEN : ${{ secrets.CARGO_REGISTRY_TOKEN }}
313339 full_archive :
314340 if : github.event_name == 'release'
315341 runs-on : ubuntu-latest
0 commit comments