chore: add pypi publish workflow and uv-first install docs
This commit is contained in:
34
.github/workflows/publish.yml
vendored
Normal file
34
.github/workflows/publish.yml
vendored
Normal 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
|
||||
22
README.md
22
README.md
@@ -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
|
||||
```
|
||||
|
||||
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user