Add PyPI publishing workflow and update license

- Created GitHub Actions workflow to build frontend and publish to PyPI
- Added license field to pyproject.toml to fix deprecation warning
- Updated .gitignore to exclude build artifacts
- Tested package building successfully

Co-authored-by: RockChinQ <45992437+RockChinQ@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-11-07 14:01:07 +00:00
parent cab573f3e2
commit 62d6dae4f5
3 changed files with 59 additions and 0 deletions

53
.github/workflows/publish-to-pypi.yml vendored Normal file
View File

@@ -0,0 +1,53 @@
name: Build and Publish to PyPI
on:
workflow_dispatch:
release:
types: [published]
jobs:
build-and-publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write # Required for trusted publishing to PyPI
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Build frontend
run: |
cd web
npm install
npm run build
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build package
run: |
python -m build
- name: Check package
run: |
twine check dist/*
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true

5
.gitignore vendored
View File

@@ -47,3 +47,8 @@ uv.lock
plugins.bak
coverage.xml
.coverage
# Build artifacts
/dist
/build
*.egg-info

View File

@@ -3,6 +3,7 @@ name = "langbot"
version = "4.4.1"
description = "Easy-to-use global IM bot platform designed for LLM era"
readme = "README.md"
license = {text = "AGPL-3.0-or-later"}
requires-python = ">=3.10.1,<4.0"
dependencies = [
"aiocqhttp>=1.4.4",