51 lines
1.5 KiB
YAML
51 lines
1.5 KiB
YAML
name: deploy
|
|
|
|
on:
|
|
- push
|
|
- workflow_dispatch
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build-n-publish:
|
|
runs-on: ubuntu-latest
|
|
if: |
|
|
startsWith(github.event.ref, 'refs/tags') || github.event_name == 'workflow_dispatch'
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Set up Python 3.10.13
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: 3.10.13
|
|
- name: Install wheel
|
|
run: pip install wheel
|
|
- name: Build MMEngine
|
|
run: python setup.py sdist bdist_wheel
|
|
- name: Publish distribution to PyPI
|
|
run: |
|
|
pip install twine
|
|
twine upload dist/* -u __token__ -p ${{ secrets.pypi_password }}
|
|
|
|
build-n-publish-lite:
|
|
runs-on: ubuntu-latest
|
|
if: |
|
|
startsWith(github.event.ref, 'refs/tags') || github.event_name == 'workflow_dispatch'
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Set up Python 3.10.13
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: 3.10.13
|
|
- name: Install wheel
|
|
run: pip install wheel
|
|
- name: Build MMEngine-lite
|
|
run: |
|
|
sed -i "s/os.getenv('MMENGINE_LITE', '0')/os.getenv('MMENGINE_LITE', '1')/g" setup.py
|
|
python setup.py sdist bdist_wheel
|
|
- name: Publish distribution to PyPI
|
|
run: |
|
|
pip install twine
|
|
twine upload dist/* -u __token__ -p ${{ secrets.pypi_password }}
|