mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-09-12 20:54:35 +00:00
[workflow] hooked pypi release with lark (#2596)
This commit is contained in:
36
.github/workflows/release_pypi_after_merge.yml
vendored
36
.github/workflows/release_pypi_after_merge.yml
vendored
@@ -25,8 +25,44 @@ jobs:
|
||||
|
||||
# publish to PyPI if executed on the main branch
|
||||
- name: Publish package to PyPI
|
||||
id: publish
|
||||
uses: pypa/gh-action-pypi-publish@release/v1
|
||||
with:
|
||||
user: __token__
|
||||
password: ${{ secrets.PYPI_API_TOKEN }}
|
||||
verbose: true
|
||||
|
||||
notify:
|
||||
name: Notify Lark via webhook
|
||||
needs: release
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ always() }}
|
||||
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 latest version has been successfully released to PyPI."
|
||||
else
|
||||
msg="Failed to release Colossal-AI 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: ${{ steps.publish.outcome }}
|
||||
|
Reference in New Issue
Block a user