forked from ray-project/ray
-
Notifications
You must be signed in to change notification settings - Fork 16
181 lines (157 loc) · 6.36 KB
/
pypi-nightly.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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
name: Ant Ray PyPi Nightly
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
inputs:
branch:
description: 'Enter branch name to build wheels from (default: main)'
required: false
type: string
default: 'main'
# pull_request:
# push:
# branches:
# - main
release:
types:
- published
jobs:
build_linux_wheels_aarch64:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-24.04-arm]
python-version: [39, 310, 311]
arch: [aarch64]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch || 'main' }}
- name: Build wheels
uses: pypa/cibuildwheel@v2.22.0
env:
CIBW_BEFORE_BUILD_LINUX: yum install -y epel-release && yum -y update && yum -y install curl && curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash && export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")" && [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && nvm install 16.20.2 && nvm use 16.20.2 && pip install "cython>=0.29.32" wheel && ./ci/env/install-bazel.sh && pushd python/ray/dashboard/client && npm ci && npm run build && popd
CIBW_BUILD: cp${{ matrix.python-version }}-manylinux_${{ matrix.arch }}*
CIBW_ENVIRONMENT: RAY_DEBUG_BUILD=nightly
with:
package-dir: ./python
output-dir: ./python/dist
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./python/dist/*.whl
build_linux_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: [39, 310, 311]
arch: [x86_64]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch || 'main' }}
- name: Build wheels
uses: pypa/cibuildwheel@v2.22.0
env:
CIBW_BEFORE_BUILD_LINUX: yum install -y epel-release && yum -y update && yum -y install npm && pip install "cython>=0.29.32" wheel && ./ci/env/install-bazel.sh && pushd python/ray/dashboard/client && npm -g install npm@8.19.2 && npm ci && npm run build && popd
CIBW_BUILD: cp${{ matrix.python-version }}-manylinux_${{ matrix.arch }}*
CIBW_ENVIRONMENT: RAY_DEBUG_BUILD=nightly
with:
package-dir: ./python
output-dir: ./python/dist
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./python/dist/*.whl
build_macos_wheels13:
name: Build macOS wheels (${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-13]
python-version: [39, 310, 311]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch || 'main' }}
- name: Build wheels
uses: pypa/cibuildwheel@v2.22.0
env:
CIBW_BEFORE_BUILD: brew install node && pip install "cython>=0.29.32" wheel && sudo ./ci/env/install-bazel.sh && python -m ensurepip --upgrade && sudo chmod a+x /Users/runner/bin/bazel && sudo chown -R runner /Users/runner/Library/Caches/bazelisk && pushd python/ray/dashboard/client && npm ci && npm run build && popd
CIBW_BUILD: cp${{ matrix.python-version }}-macosx_*
MACOSX_DEPLOYMENT_TARGET: 14.2
CIBW_ENVIRONMENT: RAY_DEBUG_BUILD=nightly
with:
package-dir: ./python
output-dir: ./python/dist
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./python/dist/*.whl
build_macos_wheels:
name: Build macOS wheels (${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-14]
python-version: [39, 310, 311]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch || 'main' }}
- name: Build wheels
uses: pypa/cibuildwheel@v2.22.0
env:
CIBW_BEFORE_BUILD: brew install node && pip install "cython>=0.29.32" wheel && sudo ./ci/env/install-bazel.sh && python -m ensurepip --upgrade && sudo chmod a+x /Users/runner/bin/bazel && sudo chown -R runner /Users/runner/Library/Caches/bazelisk && pushd python/ray/dashboard/client && npm ci && npm run build && popd
CIBW_BUILD: cp${{ matrix.python-version }}-macosx_*
MACOSX_DEPLOYMENT_TARGET: 14.5
CIBW_ENVIRONMENT: RAY_DEBUG_BUILD=nightly
with:
package-dir: ./python
output-dir: ./python/dist
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./python/dist/*.whl
upload_pypi:
needs: [build_macos_wheels, build_macos_wheels13, build_linux_wheels, build_linux_wheels_aarch64]
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
# if: github.event_name == 'release' && github.event.action == 'published'
# # or, alternatively, upload to PyPI on every tag starting with 'v' (remove on: release above to use this)
# # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v4
with:
# unpacks all CIBW artifacts into dist/
pattern: cibw-*
path: python/dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: python/dist
skip-existing: true
upload_test_pypi:
needs: [build_macos_wheels, build_macos_wheels13, build_linux_wheels, build_linux_wheels_aarch64]
runs-on: ubuntu-latest
environment: testpypi-publish
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
# unpacks all CIBW artifacts into dist/
pattern: cibw-*
path: python/dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: python/dist
repository-url: https://test.pypi.org/legacy/
skip-existing: true