Skip to content

Commit af099a7

Browse files
CI: Push NumPy Pyodide wheels to Anaconda.org
This commit adds a schedule to push WASM wheels that are compiled via the Emscripten toolchain and Pyodide ecosystem to NumPy's PyPI-like index on Anaconda.org. The key changes here, are: 1. A schedule has been added to the job 2. A workflow_dispatch trigger has been added to push the wheels manually if needed 3. A step has been added that runs after the tests run and succeed, which uses a repository secret that is NUMPY_NIGHTLY_UPLOAD_TOKEN. The artifacts can then be found on this link: https://anaconda.org/scientific-python-nightly-wheels/numpy The wheels uploads will not be attempted on forks or on workflow run contexts outside of the provided condition(s) in the newly added step. [skip cirrus] [skip circle] [skip azp] [skip travis]
1 parent a52c49a commit af099a7

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

.github/workflows/emscripten.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,26 @@ on:
55
branches:
66
- main
77
- maintenance/**
8+
# Note: this workflow gets triggered on the same schedule as the
9+
# wheels.yml workflow, with the exception that this workflow runs
10+
# the test suite for the Pyodide wheel too, prior to uploading it.
11+
#
12+
# Run on schedule to upload to Anaconda.org
13+
schedule:
14+
# ┌───────────── minute (0 - 59)
15+
# │ ┌───────────── hour (0 - 23)
16+
# │ │ ┌───────────── day of the month (1 - 31)
17+
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
18+
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
19+
# │ │ │ │ │
20+
- cron: "42 2 * * SUN,WED"
21+
workflow_dispatch:
22+
inputs:
23+
push_wheels:
24+
description: >
25+
Push wheels to Anaconda.org if the build is successful, can be 'true' or 'false'. Default is 'false'. Warning: this will overwrite existing wheels.
26+
required: false
27+
default: 'false'
828

929
env:
1030
FORCE_COLOR: 3
@@ -90,3 +110,15 @@ jobs:
90110
source .venv-pyodide/bin/activate
91111
cd ..
92112
pytest --pyargs numpy -m "not slow"
113+
114+
# Push to https://anaconda.org/scientific-python-nightly-wheels/numpy
115+
# WARNING: this job will overwrite any existing WASM wheels.
116+
- name: Push to Anaconda PyPI index
117+
if: >-
118+
(github.repository == 'numpy/numpy') &&
119+
(github.event_name == 'workflow_dispatch' && github.event.inputs.push_wheels == 'true') ||
120+
(github.event_name == 'schedule')
121+
uses: scientific-python/upload-nightly-action@b67d7fcc0396e1128a474d1ab2b48aa94680f9fc # v0.5.0
122+
with:
123+
artifacts_path: dist/
124+
anaconda_nightly_upload_token: ${{ secrets.NUMPY_NIGHTLY_UPLOAD_TOKEN }}

0 commit comments

Comments
 (0)