feat(ci): Add release pipy workflow (#2222)

This commit is contained in:
Fangyin Cheng
2024-12-20 09:59:50 +08:00
committed by GitHub
parent d4031f0dd8
commit 0ed793e121

View File

@@ -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 }}