-
Notifications
You must be signed in to change notification settings - Fork 0
137 lines (121 loc) · 4.63 KB
/
build.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: Build PyArrow and LightGBM
on:
pull_request:
workflow_dispatch:
release:
types: [published]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: "3.12"
- name: Install system-level dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
cmake bzip2 ccache f2c g++ gfortran git make \
patch pkg-config swig unzip wget xz-utils \
autoconf autotools-dev automake texinfo dejagnu \
build-essential libtool libltdl-dev \
gnupg2 libdbus-glib-1-2 sudo sqlite3 \
ninja-build jq xxd
- name: Cache ccache outputs
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: /tmp/ccache
key: ccache-${{ hashFiles('Makefile.envs') }}
- name: Check out Pyodide, and the NumPy v2 mirror branch
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
repository: pyodide/pyodide
ref: numpy-v2-update-mirror
path: pyodide_checkout
submodules: recursive
- name: Restore cached built packages
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: |
pyodide_checkout/packages/.libs/*
pyodide_checkout/packages/.artifacts/*
pyodide_checkout/dist/*.whl
key: pyodide-packages-${{ hashFiles('pyodide_checkout/packages/recipes/**/*.yaml') }}
- run: echo "PYODIDE_JOBS=$(nproc)" >> "$GITHUB_ENV"
- name: Build Pyodide packages with NumPy v2 enabled
working-directory: pyodide_checkout/
run: |
source pyodide_env.sh
ccache -z
make -C emsdk
make -C cpython
pip install -e ./pyodide-build
pyodide build-recipes "pyarrow,lightgbm" --install
ccache -s
- name: Save ccached outputs
uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: /tmp/ccache
key: ccache-${{ hashFiles('Makefile.envs') }}
- name: Upload PyArrow and LightGBM wheels
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
with:
name: pyarrow-lightgbm-wheels
path: |
pyodide_checkout/dist/pyarrow-*.whl
pyodide_checkout/dist/lightgbm-*.whl
if-no-files-found: error
retention-days: 1
publish:
runs-on: ubuntu-latest
needs: [build]
if: >-
github.repository == 'pyodide/pyodide-numpy-2.0-rebuilds' &&
github.event_name == 'release' &&
github.event.action == 'published'
permissions:
# Required to sign the attestations
id-token: write
attestations: write
# Required to upload to a GitHub release identifier
contents: write
steps:
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: pyarrow-lightgbm-wheels
path: dist
merge-multiple: true
- name: Copy PyArrow and LightGBM wheels from artifacts
run: |
mkdir -p packages
cp dist/pyarrow-*.whl packages/
cp dist/lightgbm-*.whl packages/
- name: Generate attestations for these wheels
uses: actions/attest-build-provenance@7668571508540a607bdfd90a87a560489fe372eb # v2.1.0
with:
subject-path: |
packages/*.whl
- name: Verify them, to ensure that the wheels they were attested correctly
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: |
for artifact in packages/*; do
echo "# ${artifact}"
gh attestation verify "${artifact}" --repo ${{ github.repository }}
done
- name: Create GitHub release with these wheels
uses: softprops/action-gh-release@01570a1f39cb168c169c802c3bceb9e93fb10974 # v2.1.0
if: >-
github.repository == 'pyodide/pyodide-numpy-2.0-rebuilds' &&
github.event_name == 'release' &&
github.event.action == 'published'
with:
files: |
packages/*.whl
fail_on_unmatched_files: true
name: PyArrow and LightGBM wheels, built against NumPy 2.0 via Pyodide gh-4925