forked from ray-project/ray
-
Notifications
You must be signed in to change notification settings - Fork 16
41 lines (37 loc) · 1.06 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
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: |
python setup.py python/bdist_wheel
- name: Upload
if: env.COMMIT_TODAY == 'true'
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}