mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-15 05:59:59 +00:00
ci(pypi): publish to pypi
This commit is contained in:
49
.github/workflows/python-publish.yml
vendored
49
.github/workflows/python-publish.yml
vendored
@@ -17,6 +17,17 @@ on:
|
|||||||
description: 'Package version (e.g. 0.7.0rc0)'
|
description: 'Package version (e.g. 0.7.0rc0)'
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
|
publish_to_testpypi:
|
||||||
|
description: 'Publish to TestPyPI'
|
||||||
|
required: false
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
publish_to_pypi:
|
||||||
|
description: 'Publish to PyPI'
|
||||||
|
required: false
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|
||||||
@@ -24,18 +35,18 @@ jobs:
|
|||||||
deploy:
|
deploy:
|
||||||
name: python
|
name: python
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install uv
|
- name: Install uv
|
||||||
uses: astral-sh/setup-uv@v5
|
uses: astral-sh/setup-uv@v5
|
||||||
|
|
||||||
- name: "Set up Python"
|
- name: "Set up Python"
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version-file: ".python-version"
|
python-version-file: ".python-version"
|
||||||
|
|
||||||
- name: Update version
|
- name: Update version
|
||||||
run: |
|
run: |
|
||||||
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
||||||
@@ -47,29 +58,31 @@ jobs:
|
|||||||
else
|
else
|
||||||
echo "Prepping package for release"
|
echo "Prepping package for release"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Install the project
|
- name: Install the project
|
||||||
run: uv sync --all-packages --dev
|
run: uv sync --all-packages --dev
|
||||||
|
|
||||||
- name: Build package using Make
|
- name: Build package using Make
|
||||||
run: |
|
run: |
|
||||||
make build
|
make build
|
||||||
ls dist/
|
ls dist/
|
||||||
|
|
||||||
- name: Upload wheel as artifact
|
- name: Upload wheel as artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: dist-packages
|
name: dist-packages
|
||||||
path: dist/*
|
path: dist/*
|
||||||
retention-days: 7
|
retention-days: 7
|
||||||
|
|
||||||
# - name: Publish package to TestPyPI
|
- name: Publish package to TestPyPI
|
||||||
# uses: pypa/gh-action-pypi-publish@release/v1
|
if: ${{ github.event_name == 'workflow_dispatch' && inputs.publish_to_testpypi == true }}
|
||||||
# with:
|
uses: pypa/gh-action-pypi-publish@release/v1
|
||||||
# password: ${{ secrets.TEST_PYPI_API_TOKEN }}
|
with:
|
||||||
# repository-url: https://test.pypi.org/legacy/
|
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
|
||||||
|
repository-url: https://test.pypi.org/legacy/
|
||||||
# - name: Publish package distributions to PyPI
|
|
||||||
# uses: pypa/gh-action-pypi-publish@release/v1
|
- name: Publish package distributions to PyPI
|
||||||
# with:
|
if: ${{ github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && inputs.publish_to_pypi == true) }}
|
||||||
# password: ${{ secrets.PYPI_API_TOKEN }}
|
uses: pypa/gh-action-pypi-publish@release/v1
|
||||||
|
with:
|
||||||
|
password: ${{ secrets.PYPI_API_TOKEN }}
|
Reference in New Issue
Block a user