av commited on
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,10 +1,96 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: docker
|
|
|
|
| 7 |
pinned: false
|
| 8 |
---
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: DrivePurge Release Automation
|
| 3 |
+
emoji: ๐๏ธ
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: indigo
|
| 6 |
sdk: docker
|
| 7 |
+
app_port: 7860
|
| 8 |
pinned: false
|
| 9 |
---
|
| 10 |
|
| 11 |
+
# DrivePurge Release Automation API
|
| 12 |
+
|
| 13 |
+
FastAPI server that automates version tracking, release scanning,
|
| 14 |
+
per-OS asset mirroring, and metadata JSON generation for the
|
| 15 |
+
[DrivePurge_](https://github.com/Drive-Purge/DrivePurge_) GitHub repository.
|
| 16 |
+
|
| 17 |
+
## ๐ง Environment Variables (set in Space Secrets)
|
| 18 |
+
|
| 19 |
+
| Variable | Required | Default | Description |
|
| 20 |
+
|---|---|---|---|
|
| 21 |
+
| `GITHUB_TOKEN` | โ
| โ | Fine-grained PAT: **Contents R/W**, **Metadata R** |
|
| 22 |
+
| `REPO_OWNER` | | `Drive-Purge` | GitHub org / user |
|
| 23 |
+
| `REPO_NAME` | | `DrivePurge_` | Repository name |
|
| 24 |
+
| `OUTPUT_DIR` | | `/tmp/releases` | Where assets + JSONs are written |
|
| 25 |
+
|
| 26 |
+
## ๐ Endpoints
|
| 27 |
+
|
| 28 |
+
| Method | Path | Description |
|
| 29 |
+
|---|---|---|
|
| 30 |
+
| `GET` | `/health` | Ping |
|
| 31 |
+
| `POST` | `/update-file` | Push any file to the repo |
|
| 32 |
+
| `GET` | `/releases` | All releases with per-OS download URLs |
|
| 33 |
+
| `GET` | `/releases/{tag}` | Single release detail + `by_os` breakdown |
|
| 34 |
+
| `POST` | `/process-release/{tag}` | Download assets + write `release{ver}.json` |
|
| 35 |
+
| `POST` | `/trigger` | **Full pipeline** |
|
| 36 |
+
|
| 37 |
+
Swagger UI: `https://<your-space>.hf.space/docs`
|
| 38 |
+
|
| 39 |
+
## ๐ฆ Asset JSON Schema (per asset)
|
| 40 |
+
|
| 41 |
+
```json
|
| 42 |
+
{
|
| 43 |
+
"name": "DrivePurge-linux-amd64-v1.0.zip",
|
| 44 |
+
"os": "linux",
|
| 45 |
+
"arch": "x86_64",
|
| 46 |
+
"size_bytes": 214202000,
|
| 47 |
+
"download_url": "https://github.com/.../DrivePurge-linux-amd64-v1.0.zip",
|
| 48 |
+
"content_type": "application/zip",
|
| 49 |
+
"created_at": "2026-05-24T06:20:47Z",
|
| 50 |
+
"local_path": "/tmp/releases/release1_0/DrivePurge-linux-amd64-v1.0.zip"
|
| 51 |
+
}
|
| 52 |
+
```
|
| 53 |
+
|
| 54 |
+
## ๐๏ธ Full Release JSON
|
| 55 |
+
|
| 56 |
+
```json
|
| 57 |
+
{
|
| 58 |
+
"repo": "Drive-Purge/DrivePurge_",
|
| 59 |
+
"tag": "v1.0",
|
| 60 |
+
"name": "DrivePurge v1.0",
|
| 61 |
+
"body": "...",
|
| 62 |
+
"published_at": "2026-05-24T06:24:00Z",
|
| 63 |
+
"html_url": "https://github.com/...",
|
| 64 |
+
"assets": [ ...all assets flat... ],
|
| 65 |
+
"by_os": {
|
| 66 |
+
"windows": [ ...exe + zip... ],
|
| 67 |
+
"macos": [ ...arm zip... ],
|
| 68 |
+
"linux": [ ...amd64 zip... ],
|
| 69 |
+
"all": [ ...checksums.txt... ]
|
| 70 |
+
},
|
| 71 |
+
"generated_at": "2026-05-24T07:00:00+00:00"
|
| 72 |
+
}
|
| 73 |
+
```
|
| 74 |
+
|
| 75 |
+
## ๐ฅ๏ธ OS / Arch Detection Rules
|
| 76 |
+
|
| 77 |
+
| Filename pattern | `os` | `arch` |
|
| 78 |
+
|---|---|---|
|
| 79 |
+
| `*windows*amd64*`, `*.exe` | `windows` | `x86_64` |
|
| 80 |
+
| `*windows*arm64*` | `windows` | `arm64` |
|
| 81 |
+
| `*macos*arm64*`, `*darwin*arm64*` | `macos` | `arm64` |
|
| 82 |
+
| `*macos*amd64*`, `*darwin*amd64*` | `macos` | `x86_64` |
|
| 83 |
+
| `*macos*`, `*darwin*` | `macos` | `universal` |
|
| 84 |
+
| `*linux*amd64*`, `*linux*x86_64*` | `linux` | `x86_64` |
|
| 85 |
+
| `*linux*arm64*`, `*linux*aarch64*` | `linux` | `arm64` |
|
| 86 |
+
| `*checksums*`, `*sha256*` | `all` | `all` |
|
| 87 |
+
|
| 88 |
+
## โถ๏ธ Run Locally
|
| 89 |
+
|
| 90 |
+
```bash
|
| 91 |
+
pip install -r requirements.txt
|
| 92 |
+
export GITHUB_TOKEN="ghp_..."
|
| 93 |
+
python main.py # listens on :7860
|
| 94 |
+
# or
|
| 95 |
+
uvicorn main:app --reload --port 7860
|
| 96 |
+
```
|