forked from hpcaitech/ColossalAI
-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (59 loc) · 1.99 KB
/
release_nightly_on_schedule.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
name: Publish Nightly Version to PyPI
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * 6' # release on every Sunday 00:00 UTC time
jobs:
publish:
if: github.repository == 'hpcaitech/ColossalAI'
name: Build and publish Python 🐍 distributions 📦 to PyPI
runs-on: ubuntu-latest
timeout-minutes: 20
outputs:
status: ${{ steps.publish.outcome }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.8.14'
- run: |
python .github/workflows/scripts/update_setup_for_nightly.py
python setup.py sdist build
# publish to PyPI if executed on the main branch
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
id: publish
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
verbose: true
notify:
name: Notify Lark via webhook
needs: publish
runs-on: ubuntu-latest
if: ${{ always() }} && github.repository == 'hpcaitech/ColossalAI'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.8.14'
- name: Install requests
run: pip install requests
- name: Notify Lark
id: message-preparation
run: |
url=$SERVER_URL/$REPO/actions/runs/$RUN_ID
if [ $STATUS == 'success' ]
then
msg="The Colossal-AI nightly version has been successfully released to PyPI."
else
msg="Failed to release Colossal-AI nightly version to PyPI, please visit $url for details."
fi
echo $msg
python .github/workflows/scripts/send_message_to_lark.py -m "$msg" -u $WEBHOOK_URL
env:
SERVER_URL: ${{github.server_url }}
REPO: ${{ github.repository }}
RUN_ID: ${{ github.run_id }}
WEBHOOK_URL: ${{ secrets.LARK_NOTIFICATION_WEBHOOK_URL }}
STATUS: ${{ needs.publish.outputs.status }}