lightning/.github/workflows/events-nightly.yml

59 lines
1.8 KiB
YAML

name: Nightly
# https://jasonet.co/posts/scheduled-actions/
# https://github.community/t/distinct-job-for-each-schedule/17811/2
on:
schedule:
# At the end of every day
- cron: "0 0 * * *"
# based on https://github.com/pypa/gh-action-pypi-publish
jobs:
pypi-release:
if: ${{ github.repository_owner == 'Lightning-AI' }}
runs-on: ubuntu-20.04
steps:
# does nightly releases from feature branch
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install dependencies
run: >-
python -m pip install --user --upgrade setuptools wheel
- name: Build packages
run: |
pip install -q -r .actions/requirements.txt
python .actions/assistant.py prepare-nightly-version
python setup.py sdist bdist_wheel
ls -lh dist/
- name: Delay releasing
uses: juliangruber/sleep-action@v1
with:
time: 5m
# We do this, since failures on test.pypi aren't that bad
- name: Publish to Test PyPI
uses: pypa/gh-action-pypi-publish@v1.5.1
with:
user: __token__
password: ${{ secrets.test_pypi_password }}
repository_url: https://test.pypi.org/legacy/
verbose: true
# report failure to Slack
- name: Slack notification
if: failure() && github.event_name == 'schedule'
uses: ravsamhq/notify-slack-action@v2
with:
status: ${{ job.status }}
token: ${{ secrets.GITHUB_TOKEN }}
notification_title: 'Publish nightly package to test.pypi.org'
message_format: '{emoji} *{workflow}* {status_message}, see <{run_url}|detail>, cc: <@UR9FXE6QG>' #Borda
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}