Skip to content

Commit

Permalink
CI: Push NumPy Pyodide wheels to Anaconda.org
Browse files Browse the repository at this point in the history
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]
  • Loading branch information
agriyakhetarpal committed Mar 25, 2024
1 parent 34fa608 commit 5709af0
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/emscripten.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,26 @@ on:
branches:
- main
- maintenance/**
# Note: this workflow gets triggered on the same schedule as the
# wheels.yml workflow, with the exception that this workflow runs
# the test suite for the Pyodide wheel too, prior to uploading it.
#
# Run on schedule to upload to Anaconda.org
schedule:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# │ │ │ │ │
- cron: "42 2 * * SUN,WED"
workflow_dispatch:
inputs:
push_wheels:
description: >
Push wheels to Anaconda.org if the build is successful, can be 'true' or 'false'. Default is 'false'. Warning: this will overwrite existing wheels.
required: false
default: 'false'

env:
FORCE_COLOR: 3
Expand Down Expand Up @@ -95,3 +115,15 @@ jobs:
source .venv-pyodide/bin/activate
cd ..
pytest --pyargs numpy -m "not slow"
# Push to https://anaconda.org/scientific-python-nightly-wheels/numpy
# WARNING: this job will overwrite any existing WASM wheels.
- name: Push to Anaconda PyPI index
if: >-
(github.repository == 'numpy/numpy') &&
(github.event_name == 'workflow_dispatch' && github.event.inputs.push_wheels == 'true') ||
(github.event_name == 'schedule')
uses: scientific-python/upload-nightly-action@b67d7fcc0396e1128a474d1ab2b48aa94680f9fc # v0.5.0
with:
artifacts_path: dist/
anaconda_nightly_upload_token: ${{ secrets.NUMPY_NIGHTLY_UPLOAD_TOKEN }}

0 comments on commit 5709af0

Please sign in to comment.