mirror of https://github.com/hpcaitech/ColossalAI
[workflow] added workflow to release to pypi upon version change (#2320)
* [workflow] added workflow to release to pypi upon version change * polish code * polish code * polish codepull/2327/head
parent
693ef121a1
commit
8d8dec09ba
|
@ -0,0 +1,32 @@
|
|||
name: Publish to PyPI
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
paths:
|
||||
- 'version.txt'
|
||||
types:
|
||||
- closed
|
||||
|
||||
jobs:
|
||||
build-n-publish:
|
||||
if: github.event_name == "workflow_dispatch" || github.repository == 'hpcaitech/ColossalAI' && github.event.pull_request.merged == true && github.base_ref == 'main'
|
||||
name: Build and publish Python 🐍 distributions 📦 to PyPI
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 20
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.8.14'
|
||||
|
||||
- run: 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
|
||||
with:
|
||||
user: __token__
|
||||
password: ${{ secrets.PYPI_API_TOKEN }}
|
||||
verbose: true
|
Loading…
Reference in New Issue