mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-27 20:38:30 +00:00
feat(ci): Add release pipy workflow (#2222)
This commit is contained in:
31
.github/workflows/python-publish.yml
vendored
31
.github/workflows/python-publish.yml
vendored
@@ -11,8 +11,12 @@ name: Upload Python Package
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
workflow_dispatch:
|
||||
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: 'Package version (e.g. 0.6.3rc2)'
|
||||
required: true
|
||||
type: string
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
@@ -21,18 +25,33 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: '3.x'
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install build
|
||||
- name: Build package
|
||||
run: python -m build
|
||||
pip install wheel setuptools
|
||||
|
||||
- name: Build package using Make
|
||||
run: |
|
||||
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
||||
DB_GPT_VERSION=${{ inputs.version }} make package
|
||||
else
|
||||
make package
|
||||
fi
|
||||
|
||||
- name: Upload wheel as artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: dist-packages
|
||||
path: dist/*
|
||||
retention-days: 7
|
||||
|
||||
- name: Publish package
|
||||
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
|
||||
with:
|
||||
user: __token__
|
||||
password: ${{ secrets.PYPI_API_TOKEN }}
|
Reference in New Issue
Block a user