mirror of
https://github.com/saltbo/zpan.git
synced 2026-09-24 23:22:31 +08:00
feat(about): add changelog drawer, latest-version check, and commit hash
Maintain a CHANGELOG.md (Keep a Changelog format) at the repo root and surface it on the admin About page: - The page now shows the running build's short commit hash next to the version, linked to the GitHub commit. Commit is injected at build time via a new resolveAppCommit() (ZPAN_APP_COMMIT -> WORKERS_CI_COMMIT_SHA -> git rev-parse), wired through vite/tsup defines, the node entry, Docker, and CI. - A new admin-only GET /api/system/changelog endpoint fetches CHANGELOG.md from master on GitHub, caches it, parses the latest released version, and reports whether an update is available (semver compare against the running version). - The About page renders a "latest version" row with an update-available badge and a side drawer that displays the changelog markdown. Tests cover the semver compare, changelog parse/fetch caching, the API wrapper, and the route (admin-gated, parsed payload). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
5a5583b4ed
commit
e700fd4977
@@ -189,6 +189,7 @@ jobs:
|
||||
- name: Build
|
||||
env:
|
||||
ZPAN_APP_VERSION: ${{ steps.release.outputs.version }}
|
||||
ZPAN_APP_COMMIT: ${{ github.sha }}
|
||||
run: pnpm build
|
||||
|
||||
- name: Deploy
|
||||
|
||||
@@ -80,6 +80,7 @@ jobs:
|
||||
platforms: linux/amd64,linux/arm64
|
||||
build-args: |
|
||||
APP_VERSION=${{ github.ref_name }}
|
||||
APP_COMMIT=${{ github.sha }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
cache-from: type=gha
|
||||
|
||||
Reference in New Issue
Block a user