mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-07-29 06:47:30 +00:00
ci(pypi): Build SDK
This commit is contained in:
parent
69933e635d
commit
33d8058d4a
71
.github/workflows/python-publish.yml
vendored
71
.github/workflows/python-publish.yml
vendored
@ -14,7 +14,7 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
version:
|
version:
|
||||||
description: 'Package version (e.g. 0.6.3rc2)'
|
description: 'Package version (e.g. 0.7.0rc0)'
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
permissions:
|
permissions:
|
||||||
@ -22,36 +22,53 @@ permissions:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
|
name: python
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Install uv
|
||||||
uses: actions/setup-python@v3
|
uses: astral-sh/setup-uv@v5
|
||||||
with:
|
|
||||||
python-version: '3.x'
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: "Set up Python"
|
||||||
run: |
|
uses: actions/setup-python@v5
|
||||||
python -m pip install --upgrade pip
|
with:
|
||||||
pip install wheel setuptools
|
python-version-file: ".python-version"
|
||||||
|
|
||||||
- name: Build package using Make
|
- name: Update version
|
||||||
run: |
|
run: |
|
||||||
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
||||||
DB_GPT_VERSION=${{ inputs.version }} make package
|
export DB_GPT_VERSION=${{ inputs.version }} make package
|
||||||
else
|
echo "Updating version in all files to $DB_GPT_VERSION"
|
||||||
make package
|
cd scripts
|
||||||
fi
|
uv run update_version_all.py $DB_GPT_VERSION -y
|
||||||
|
else
|
||||||
|
echo "Prepping package for release"
|
||||||
|
fi
|
||||||
|
- name: Install the project
|
||||||
|
run: uv sync --all-extras --dev
|
||||||
|
|
||||||
- name: Upload wheel as artifact
|
- name: Build package using Make
|
||||||
uses: actions/upload-artifact@v3
|
run: |
|
||||||
with:
|
make build
|
||||||
name: dist-packages
|
ls dist/
|
||||||
path: dist/*
|
|
||||||
retention-days: 7
|
- name: Upload wheel as artifact
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: dist-packages
|
||||||
|
path: dist/*
|
||||||
|
retention-days: 7
|
||||||
|
|
||||||
|
# - name: Publish package to TestPyPI
|
||||||
|
# uses: pypa/gh-action-pypi-publish@release/v1
|
||||||
|
# with:
|
||||||
|
# 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
|
||||||
|
# with:
|
||||||
|
# password: ${{ secrets.PYPI_API_TOKEN }}
|
||||||
|
|
||||||
- name: Publish package
|
|
||||||
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
|
|
||||||
with:
|
|
||||||
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
Loading…
Reference in New Issue
Block a user