av commited on
Commit
8ce59e3
ยท
verified ยท
1 Parent(s): 3fb154b

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +91 -5
README.md CHANGED
@@ -1,10 +1,96 @@
1
  ---
2
- title: Versioncheckerfordrivepurge
3
- emoji: ๐Ÿข
4
- colorFrom: pink
5
- colorTo: green
6
  sdk: docker
 
7
  pinned: false
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ ```