Skip to content

Commit ad4dabf

Browse files
MNT, CI: Use separate jobs for WASM wheel uploads
This PR separates out wheel builds and the wheel uploads into separate jobs, where the GHA actions are used to share artifacts between jobs. This is a slight restructure of the job, and is intended so that a new runner is assigned to the job for security reasons. [skip azp] [skip circle] [skip cirrus]
1 parent 482d81f commit ad4dabf

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

.github/workflows/emscripten.yml

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ concurrency:
3232
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
3333
cancel-in-progress: true
3434

35-
permissions:
36-
contents: read # to fetch code (actions/checkout)
3735

3836
jobs:
3937
build-wasm-emscripten:
38+
permissions:
39+
contents: read # to fetch code (actions/checkout)
4040
name: Build NumPy distribution for Pyodide
4141
runs-on: ubuntu-22.04
4242
# To enable this workflow on a fork, comment out:
@@ -57,14 +57,27 @@ jobs:
5757
with:
5858
name: cp312-pyodide_wasm32
5959
path: ./wheelhouse/*.whl
60+
if-no-files-found: error
61+
62+
# Push to https://anaconda.org/scientific-python-nightly-wheels/numpy
63+
# WARNING: this job will overwrite any existing WASM wheels.
64+
upload-wheels:
65+
name: Upload NumPy WASM wheels to Anaconda.org
66+
runs-on: ubuntu-22.04
67+
permissions: {}
68+
needs: [build-wasm-emscripten]
69+
if: >-
70+
(github.repository == 'numpy/numpy') &&
71+
(github.event_name == 'workflow_dispatch' && github.event.inputs.push_wheels == 'true') ||
72+
(github.event_name == 'schedule')
73+
steps:
74+
- name: Download wheel artifact(s)
75+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
76+
with:
77+
path: wheelhouse/
78+
merge-multiple: true
6079

61-
# Push to https://anaconda.org/scientific-python-nightly-wheels/numpy
62-
# WARNING: this job will overwrite any existing WASM wheels.
6380
- name: Push to Anaconda PyPI index
64-
if: >-
65-
(github.repository == 'numpy/numpy') &&
66-
(github.event_name == 'workflow_dispatch' && github.event.inputs.push_wheels == 'true') ||
67-
(github.event_name == 'schedule')
6881
uses: scientific-python/upload-nightly-action@b67d7fcc0396e1128a474d1ab2b48aa94680f9fc # v0.5.0
6982
with:
7083
artifacts_path: wheelhouse/

0 commit comments

Comments
 (0)