forked from numpy/numpy
-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (75 loc) · 2.95 KB
/
emscripten.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Test Emscripten/Pyodide build
on:
pull_request:
branches:
- main
- maintenance/**
# Note: this workflow gets triggered on the same schedule as the
# wheels.yml workflow to upload WASM wheels 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:
# Can be 'true' or 'false'. Default is 'false'.
# Warning: this will overwrite existing wheels.
description: >
Push wheels to Anaconda.org if the build succeeds
required: false
default: 'false'
env:
FORCE_COLOR: 3
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build-wasm-emscripten:
permissions:
contents: read # to fetch code (actions/checkout)
name: Build NumPy distribution for Pyodide
runs-on: ubuntu-22.04
# To enable this workflow on a fork, comment out:
if: github.repository == 'numpy/numpy'
steps:
- name: Checkout NumPy
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
submodules: recursive
fetch-tags: true
- uses: pypa/cibuildwheel@7940a4c0e76eb2030e473a5f864f291f63ee879b # v2.21.3
env:
CIBW_PLATFORM: pyodide
- name: Upload wheel artifact(s)
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: cp312-pyodide_wasm32
path: ./wheelhouse/*.whl
if-no-files-found: error
# Push to https://anaconda.org/scientific-python-nightly-wheels/numpy
# WARNING: this job will overwrite any existing WASM wheels.
upload-wheels:
name: Upload NumPy WASM wheels to Anaconda.org
runs-on: ubuntu-22.04
permissions: {}
needs: [build-wasm-emscripten]
if: >-
(github.repository == 'numpy/numpy') &&
(github.event_name == 'workflow_dispatch' && github.event.inputs.push_wheels == 'true') ||
(github.event_name == 'schedule')
steps:
- name: Download wheel artifact(s)
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
path: wheelhouse/
merge-multiple: true
- name: Push to Anaconda PyPI index
uses: scientific-python/upload-nightly-action@82396a2ed4269ba06c6b2988bb4fd568ef3c3d6b # v0.6.1
with:
artifacts_path: wheelhouse/
anaconda_nightly_upload_token: ${{ secrets.NUMPY_NIGHTLY_UPLOAD_TOKEN }}