Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Changelog

## v1.1.0

### Added

- **Per-platform image sizes on the `size.json` badge.** The scraper now fetches compressed layer sizes from the GHCR OCI registry API (`ghcr.io/v2/`). Multi-arch images display per-platform breakdowns (e.g. `82.5 MB (amd64) | 81.2 MB (arm64)`). Single-arch images show a plain size.
- Version-aware manifest fetching: uses the scraped version tag first, falls back to `latest` if the tag is not found on the registry.
- Best-effort resilience: a transient failure fetching one platform's manifest does not lose data for the other platforms.
- New test fixtures and 6 new unit tests covering manifest parsing and badge formatting.

### Changed

- `PackageStats.SizeBytes` (int64, never populated) replaced with `PlatformSizes` (map[string]int64) to support per-platform sizes.
- Badge formatting for size: nil/empty map returns `"unknown"`, single platform with known arch shows `"82.5 MB (amd64)"`, multiple platforms show pipe-separated breakdown.
- Updated README, wiki/Home, wiki/Badge-Usage, and wiki/Troubleshooting to reflect new OCI-based size fetching and per-platform output format.

### Fixed

- Size badge no longer shows `"unknown"` for all packages (closes GiteaLN/pkgbadge#1).

## v1.0.0

Initial release. HTML scraping for pull counts, versions, and platform architectures. Shields.io endpoint badge server.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# pkgbadge

Self-hosted badge server for GitHub Container Registry. Scrapes GHCR package pages and serves [shields.io endpoint badges](https://shields.io/badges/endpoint-badge) with pull counts, versions, image sizes, and platform info.
[![CI](https://github.com/Will-Luck/pkgbadge/actions/workflows/ci.yml/badge.svg)](https://github.com/Will-Luck/pkgbadge/actions/workflows/ci.yml)
[![Release](https://img.shields.io/github/v/release/Will-Luck/pkgbadge)](https://github.com/Will-Luck/pkgbadge/releases)
[![Licence](https://img.shields.io/github/license/Will-Luck/pkgbadge)](LICENSE)
[![Docker Pulls](https://img.shields.io/docker/pulls/willluck/pkgbadge)](https://hub.docker.com/r/willluck/pkgbadge)

Self-hosted badge server for GitHub Container Registry. Scrapes GHCR package pages and the OCI registry API to serve [shields.io endpoint badges](https://shields.io/badges/endpoint-badge) with pull counts, versions, image sizes, and platform info.

## Features

Expand Down Expand Up @@ -52,7 +57,7 @@ Then add badges to your README:
|-------|----------|---------|
| Pull count | `/owner/package/pulls.json` | `1.5k` |
| Version | `/owner/package/version.json` | `2.11.1` |
| Image size | `/owner/package/size.json` | `12.4 MB` |
| Image size | `/owner/package/size.json` | `82.5 MB (amd64) \| 79.2 MB (arm64)` |
| Platforms | `/owner/package/arch.json` | `amd64 \| arm64` |

## Configuration
Expand Down
Loading
Loading