Skip to content

Commit

Permalink
feat(ci): Add release pipy workflow (#2222)
Browse files Browse the repository at this point in the history
  • Loading branch information
fangyinc authored Dec 20, 2024
1 parent d4031f0 commit 0ed793e
Showing 1 changed file with 25 additions and 6 deletions.
31 changes: 25 additions & 6 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

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

0 comments on commit 0ed793e

Please sign in to comment.