forked from ray-project/ray
-
Notifications
You must be signed in to change notification settings - Fork 16
131 lines (117 loc) · 3.57 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
# name: Ant Ray PyPi Nightly
# on:
# schedule:
# - cron: '0 0 * * *'
# # can manually trigger the workflow
# workflow_dispatch:
# jobs:
# build-and-publish:
# # do not run in forks
# if: ${{ github.repository_owner == 'antgroup' }}
# name: build wheel and upload
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - name: Set up Python 3.9
# uses: actions/setup-python@v1
# with:
# python-version: 3.9
# - name: days since the commit date
# run: |
# :
# timestamp=$(git log --no-walk --date=unix --format=%cd $GITHUB_SHA)
# days=$(( ( $(date --utc +%s) - $timestamp ) / 86400 ))
# if [ $days -eq 0 ]; then
# echo COMMIT_TODAY=true >> $GITHUB_ENV
# fi
# - name: Build wheel
# if: env.COMMIT_TODAY == 'true'
# env:
# RAY_DEBUG_BUILD: nightly
# run: |
# cd python
# python setup.py sdist
# - name: Upload
# if: env.COMMIT_TODAY == 'true'
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# packages-dir: python/dist
# password: ${{ secrets.PYPI_API_TOKEN }}
name: Ant Ray PyPi Nightly
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
# pull_request:
# push:
# branches:
# - main
release:
types:
- published
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
# macos-13 is an intel runner, macos-14 is apple silicon
# os: [ubuntu-latest, windows-latest, macos-13, macos-14]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BEFORE_BUILD_LINUX: pip install "cython>=0.29.32" wheel && ./ci/env/install-bazel.sh
CIBW_BUILD: |
cp39-manylinux_x86_64
cp39-manylinux_aarch64
cp310-manylinux_x86_64
cp310-manylinux_aarch64
cp311-manylinux_x86_64
cp311-manylinux_aarch64
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_wheels]
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
upload_test_pypi:
needs: [build_wheels]
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/