mirror of https://github.com/hpcaitech/ColossalAI
added pypi publication CI and remove formatting CI
parent
b105371ace
commit
115bcc0b41
|
@ -49,42 +49,3 @@ jobs:
|
|||
pytest tests
|
||||
env:
|
||||
DATA: /data/scratch/cifar-10
|
||||
|
||||
format_check:
|
||||
name: Format Check
|
||||
if: github.event.pull_request.draft == false && github.base_ref == 'main' && github.head_ref == 'develop' && github.event.pull_request.base.repo.full_name == 'hpcaitech/ColossalAI'
|
||||
needs: [build]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: autoyapf
|
||||
id: autoyapf
|
||||
uses: mritunjaysharma394/autoyapf@v2
|
||||
with:
|
||||
args: --style google --recursive --in-place .
|
||||
|
||||
- name: Check for modified files
|
||||
id: git-check
|
||||
run: echo ::set-output name=modified::$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi)
|
||||
|
||||
- name: Push changes
|
||||
if: steps.git-check.outputs.modified == 'true'
|
||||
run: |
|
||||
git config --global user.name 'github-actions'
|
||||
git config --global user.email 'github-actions@github.com'
|
||||
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
|
||||
git commit -am "Automated autoyapf fixes"
|
||||
|
||||
- name: Create Pull Request
|
||||
# if: steps.format.outputs.has-changes == 'true'
|
||||
uses: peter-evans/create-pull-request@v3
|
||||
with:
|
||||
title: '[Bot] Automated PR to fix formatting errors'
|
||||
body: |
|
||||
Automated PR to fix formatting errors
|
||||
committer: GitHub <noreply@github.com>
|
||||
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
||||
assignees: ${{ github.actor }}
|
||||
reviewers: frankleeeee
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
name: Publish to PyPI
|
||||
on: workflow_dispatch
|
||||
|
||||
jobs:
|
||||
build-n-publish:
|
||||
if: (github.base_ref == 'main' || github.base_ref == 'develop') && github.repository == 'hpcaitech/ColossalAI' && contains('["FrankLeeeee", "ver217", "feifeibear", "kurisusnowdeng"]', github.actor)
|
||||
name: Build and publish Python 🐍 distributions 📦 to PyPI or Test PyPI
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 20
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-python@v2
|
||||
# publish to PyPI if executed on the main branch
|
||||
# publish to Test PyPI if executed on the develop branch
|
||||
- name: Publish package to Test PyPI
|
||||
if: github.base_ref == 'develop'
|
||||
uses: pypa/gh-action-pypi-publish@release/v1
|
||||
with:
|
||||
user: __token__
|
||||
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
|
||||
- name: Publish package to PyPI
|
||||
if: github.base_ref == 'main'
|
||||
uses: pypa/gh-action-pypi-publish@release/v1
|
||||
with:
|
||||
user: __token__
|
||||
password: ${{ secrets.PYPI_API_TOKEN }}
|
Loading…
Reference in New Issue