From 0ed793e121527ea3696c60122e5ae79fb5c3022a Mon Sep 17 00:00:00 2001 From: Fangyin Cheng Date: Fri, 20 Dec 2024 09:59:50 +0800 Subject: [PATCH] feat(ci): Add release pipy workflow (#2222) --- .github/workflows/python-publish.yml | 31 ++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 9d5e52d7b..dd68eb879 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -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 }} \ No newline at end of file