chore: add pypi publish workflow and uv-first install docs

This commit is contained in:
jackwener
2026-03-05 16:16:00 +08:00
parent 6f322ff2d6
commit 1ca62d4635
3 changed files with 56 additions and 5 deletions

34
.github/workflows/publish.yml vendored Normal file
View File

@@ -0,0 +1,34 @@
name: Publish to PyPI
on:
push:
tags:
- "v*"
workflow_dispatch:
jobs:
verify:
uses: ./.github/workflows/ci.yml
publish:
needs: verify
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Setup uv
uses: astral-sh/setup-uv@v6
- name: Build package
run: uv build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

View File

@@ -4,13 +4,27 @@ Twitter/X 命令行工具 — 读取 Timeline、书签和用户信息。
**零 API Key** — 使用浏览器 Cookie 认证,免费访问 Twitter。
## 安装
```bash
# 推荐uv tool更快隔离环境
uv tool install twitter-cli
# 其次pipx
pipx install twitter-cli
```
从源码安装:
```bash
git clone git@github.com:jackwener/twitter-cli.git
cd twitter-cli
uv sync
```
## Quick Start
```bash
# 安装
cd twitter-cli
uv sync
# 运行(自动从 Chrome 提取 Cookie
twitter feed
```

View File

@@ -5,7 +5,7 @@ build-backend = "hatchling.build"
[project]
name = "twitter-cli"
version = "0.1.0"
description = "A CLI for Twitter/X — feed, bookmarks, tweet, filtering"
description = "A CLI for Twitter/X — feed, bookmarks, and user timeline in terminal"
readme = "README.md"
license = "Apache-2.0"
requires-python = ">=3.8"
@@ -52,3 +52,6 @@ python_files = ["test_*.py"]
[tool.ruff]
line-length = 100
[tool.hatch.build.targets.wheel]
packages = ["twitter_cli"]