diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b2d9fb..224f8ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ 记录 OpenStats 应用的功能新增、样式调整和问题修复,按版本与日期倒序排列。 官网、构建与发布脚本等不影响应用本身的改动不在此记录。 -## 未发布 +## 0.2.0 · 2026-09-13 ### 2026-09-13 diff --git a/README.md b/README.md index 2dd7ee4..760918c 100644 --- a/README.md +++ b/README.md @@ -6,13 +6,12 @@ **Your Mac at a glance — CPU, GPU, memory, network and temperatures in the menu bar, with fan control, keep-awake and one-click cleanup.** -[![Release](https://img.shields.io/github/v/release/gentpan/OpenStats?color=6ee02b&label=release)](https://github.com/gentpan/OpenStats/releases/latest) -[![Downloads](https://img.shields.io/github/downloads/gentpan/OpenStats/total?color=6ee02b&label=downloads)](https://github.com/gentpan/OpenStats/releases) +[![Release](https://img.shields.io/badge/release-0.2.0-6ee02b)](https://getopenstats.com/#download) [![Stars](https://img.shields.io/github/stars/gentpan/OpenStats?style=flat&color=f5c518&label=stars)](https://github.com/gentpan/OpenStats/stargazers) [![Last commit](https://img.shields.io/github/last-commit/gentpan/OpenStats?color=black&label=last%20commit)](https://github.com/gentpan/OpenStats/commits/main) [![Commit activity](https://img.shields.io/github/commit-activity/m/gentpan/OpenStats?color=black&label=commits)](https://github.com/gentpan/OpenStats/graphs/commit-activity) [![CI](https://github.com/gentpan/OpenStats/actions/workflows/ci.yml/badge.svg)](https://github.com/gentpan/OpenStats/actions/workflows/ci.yml) -[![macOS](https://img.shields.io/badge/macOS-14%2B-black)](https://github.com/gentpan/OpenStats/releases/latest) +[![macOS](https://img.shields.io/badge/macOS-14%2B-black)](https://getopenstats.com/#download) [![License](https://img.shields.io/badge/license-MIT-black)](LICENSE) OpenStats is a macOS menu-bar app that shows what your Mac is doing right now — per-core @@ -20,7 +19,7 @@ CPU load, GPU, memory pressure, network speed, disk, battery, temperatures and f lets you act on it: spin the fans up, keep the Mac awake with the lid closed, clear caches. Everything is read on your own Mac. No account, no telemetry. The only network traffic is optional and on demand: a public-IP lookup when you open network details, and a ping probe to a target you choose. -[Download](https://github.com/gentpan/OpenStats/releases/latest) · +[Download](https://getopenstats.com/#download) · [Website](https://getopenstats.com) · [Changelog](CHANGELOG.md) · [Architecture](ARCHITECTURE.md) @@ -33,10 +32,12 @@ Everything is read on your own Mac. No account, no telemetry. The only network t ## Install -OpenStats has not had a release yet. The first one will be a `.dmg` on -[Releases](https://github.com/gentpan/OpenStats/releases/latest), signed with a Developer ID -certificate and notarized by Apple, followed by a Homebrew cask. Until then, build it from -source — see [Build & run](#build--run). +Download [OpenStats 0.2.0](https://getopenstats.com/download/OpenStats-0.2.0.dmg) from the website +(signed with a Developer ID certificate and notarized by Apple), or install it with Homebrew: + +```bash +brew install --cask gentpan/tap/openstats +``` Requires macOS 14 (Sonoma) or later. Developed and tested on Apple Silicon. The interface is in Simplified Chinese. @@ -46,10 +47,10 @@ Developed and tested on Apple Silicon. The interface is in Simplified Chinese. -Not released yet · **48** changes in development · [full changelog](CHANGELOG.md) (kept in Chinese) +Latest release **0.2.0** (2026-09-13) · [full changelog](CHANGELOG.md) (kept in Chinese)
-2026-09-13 · Unreleased · 30 added · 12 style · 6 fixed +2026-09-13 · 0.2.0 · 30 added · 12 style · 6 fixed **Added** diff --git a/README.zh-CN.md b/README.zh-CN.md index 0055edb..b5603ba 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -6,20 +6,19 @@ **Mac 的状态,抬眼就看见——CPU、GPU、内存、网络与温度常驻菜单栏,还能调风扇、防休眠、一键清理。** -[![Release](https://img.shields.io/github/v/release/gentpan/OpenStats?color=6ee02b&label=%E7%89%88%E6%9C%AC)](https://github.com/gentpan/OpenStats/releases/latest) -[![Downloads](https://img.shields.io/github/downloads/gentpan/OpenStats/total?color=6ee02b&label=%E4%B8%8B%E8%BD%BD)](https://github.com/gentpan/OpenStats/releases) +[![Release](https://img.shields.io/badge/%E7%89%88%E6%9C%AC-0.2.0-6ee02b)](https://getopenstats.com/#download) [![Stars](https://img.shields.io/github/stars/gentpan/OpenStats?style=flat&color=f5c518&label=%E6%98%9F%E6%A0%87)](https://github.com/gentpan/OpenStats/stargazers) [![Last commit](https://img.shields.io/github/last-commit/gentpan/OpenStats?color=black&label=%E6%9C%80%E8%BF%91%E6%8F%90%E4%BA%A4)](https://github.com/gentpan/OpenStats/commits/main) [![Commit activity](https://img.shields.io/github/commit-activity/m/gentpan/OpenStats?color=black&label=%E6%8F%90%E4%BA%A4)](https://github.com/gentpan/OpenStats/graphs/commit-activity) [![CI](https://github.com/gentpan/OpenStats/actions/workflows/ci.yml/badge.svg)](https://github.com/gentpan/OpenStats/actions/workflows/ci.yml) -[![macOS](https://img.shields.io/badge/macOS-14%2B-black)](https://github.com/gentpan/OpenStats/releases/latest) +[![macOS](https://img.shields.io/badge/macOS-14%2B-black)](https://getopenstats.com/#download) [![License](https://img.shields.io/badge/license-MIT-black)](LICENSE) OpenStats 是一款 macOS 菜单栏应用,实时显示 Mac 正在做什么:各核心 CPU 负载、GPU、内存压力、 网速、磁盘、电池、温度和风扇,并且可以直接处理:给风扇提速、合盖后继续运行、清理缓存。 所有数据都在你自己的 Mac 上读取。无需注册账号,没有统计上报。只有两项可关闭的网络功能会联网:打开网络详情时查询公网 IP,以及定时 ping 你选择的探测目标。 -[下载](https://github.com/gentpan/OpenStats/releases/latest) · +[下载](https://getopenstats.com/#download) · [官网](https://getopenstats.com) · [更新日志](CHANGELOG.md) · [架构说明](ARCHITECTURE.md) @@ -32,9 +31,12 @@ OpenStats 是一款 macOS 菜单栏应用,实时显示 Mac 正在做什么: ## 安装 -OpenStats 还没有发布正式版本。第一个版本会在 [Releases](https://github.com/gentpan/OpenStats/releases/latest) -提供 `.dmg`,使用 Developer ID 证书签名并经过 Apple 公证,之后提供 Homebrew cask。 -在此之前请从源码构建,见[构建与运行](#构建与运行)。 +从官网下载 [OpenStats 0.2.0](https://getopenstats.com/download/OpenStats-0.2.0.dmg)(Developer ID 签名、经过 Apple 公证), +或者用 Homebrew 安装: + +```bash +brew install --cask gentpan/tap/openstats +``` 需要 macOS 14(Sonoma)或更高版本。在 Apple Silicon 上开发和测试。 界面为简体中文。 @@ -44,10 +46,10 @@ OpenStats 还没有发布正式版本。第一个版本会在 [Releases](https:/ -尚未发布正式版本 · 开发中 **48** 项改动尚未发布 · [完整更新日志](CHANGELOG.md) +最新版本 **0.2.0**(2026-09-13) · [完整更新日志](CHANGELOG.md)
-2026-09-13 · 未发布 · 新增 30 · 样式 12 · 修复 6 +2026-09-13 · 0.2.0 · 新增 30 · 样式 12 · 修复 6 **新增** diff --git a/Scripts/deploy_site.sh b/Scripts/deploy_site.sh index 1850698..96e0840 100755 --- a/Scripts/deploy_site.sh +++ b/Scripts/deploy_site.sh @@ -24,8 +24,9 @@ echo "内容指纹 v=$STAMP" # 目录归部署用户所有,Caddy 只需读取 "${SSH[@]}" "$HOST" "sudo mkdir -p $ROOT && sudo chown -R \$(id -un):\$(id -gn) $ROOT" -# geoip/ 由服务器上的定时任务生成,不在 web/ 里——排除掉,否则 --delete 会把数据库删了 -rsync -az --delete --exclude /geoip/ -e "${SSH[*]}" web/ "$HOST:$ROOT/" +# geoip/ 由服务器上的定时任务生成,download/ 是 publish_release.sh 上传的安装包,都不在 web/ 里—— +# 排除掉,否则 --delete 会把它们删了 +rsync -az --delete --exclude /geoip/ --exclude /download/ -e "${SSH[*]}" web/ "$HOST:$ROOT/" "${SSH[@]}" "$HOST" "sudo chmod -R a+rX $ROOT" echo "已同步到 $HOST:$ROOT" diff --git a/Scripts/publish_release.sh b/Scripts/publish_release.sh new file mode 100755 index 0000000..32d7aad --- /dev/null +++ b/Scripts/publish_release.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# 发布已公证的版本:DMG 上传到官网 /download/,cask 提交到 gentpan/homebrew-tap,并校验线上文件。 +# +# ./Scripts/release.sh # 先打包、公证 +# ./Scripts/publish_release.sh # 再发布 +set -euo pipefail +cd "$(dirname "$0")/.." + +HOST="${SITE_HOST:-debian@15.204.80.137}" +KEY="${SITE_KEY:-$HOME/.ssh/gentpan.pem}" +ROOT="${SITE_ROOT:-/var/www/getopenstats.com}" +TAP="${TAP:-gentpan/homebrew-tap}" +VERSION="$(sed -nE 's/^ *MARKETING_VERSION: *"?([0-9.]+)"?.*/\1/p' project.yml | head -1)" +DMG="dist/OpenStats-${VERSION}.dmg" +CASK="dist/openstats.rb" +SSH=(ssh -i "$KEY" -o BatchMode=yes "$HOST") + +[ -f "$DMG" ] && [ -f "$CASK" ] || { echo "缺少 $DMG 或 $CASK,先运行 ./Scripts/release.sh" >&2; exit 1; } +grep -q "version \"${VERSION}\"" "$CASK" || { echo "$CASK 的版本不是 ${VERSION}" >&2; exit 1; } +xcrun stapler validate "$DMG" >/dev/null || { echo "$DMG 没有装订公证票据" >&2; exit 1; } +SHA="$(shasum -a 256 "$DMG" | cut -d' ' -f1)" +grep -q "$SHA" "$CASK" || { echo "$CASK 里的 sha256 与 DMG 不一致" >&2; exit 1; } + +# 上传:先传临时名再改名,下载中途不会拿到半个文件 +"${SSH[@]}" "sudo install -d -o \$(id -un) -m 755 $ROOT/download" +scp -i "$KEY" -o BatchMode=yes "$DMG" "$HOST:$ROOT/download/.OpenStats-${VERSION}.dmg.part" +"${SSH[@]}" "mv -f $ROOT/download/.OpenStats-${VERSION}.dmg.part $ROOT/download/OpenStats-${VERSION}.dmg && chmod 644 $ROOT/download/OpenStats-${VERSION}.dmg" + +URL="https://getopenstats.com/download/OpenStats-${VERSION}.dmg" +ONLINE="$(curl -fsSL --max-time 300 "$URL" | shasum -a 256 | cut -d' ' -f1)" +[ "$ONLINE" = "$SHA" ] || { echo "线上 DMG 校验不一致:$ONLINE" >&2; exit 1; } +echo "✅ $URL" + +# Homebrew tap +WORK="$(mktemp -d)" +trap 'rm -rf "$WORK"' EXIT +gh repo clone "$TAP" "$WORK/tap" -- --quiet +mkdir -p "$WORK/tap/Casks" +cp "$CASK" "$WORK/tap/Casks/openstats.rb" +if git -C "$WORK/tap" diff --quiet -- Casks/openstats.rb && git -C "$WORK/tap" ls-files --error-unmatch Casks/openstats.rb >/dev/null 2>&1; then + echo "✅ $TAP 已是 ${VERSION}" +else + git -C "$WORK/tap" add Casks/openstats.rb + git -C "$WORK/tap" commit -q -m "openstats ${VERSION}" + git -C "$WORK/tap" push -q + echo "✅ 已提交 Casks/openstats.rb 到 $TAP" +fi +echo "安装:brew install --cask gentpan/tap/openstats" diff --git a/Scripts/release.sh b/Scripts/release.sh index 23cd051..1014649 100755 --- a/Scripts/release.sh +++ b/Scripts/release.sh @@ -12,7 +12,8 @@ set -euo pipefail cd "$(dirname "$0")/.." -REPO="${REPO:-gentpan/OpenStats}" +# 安装包放在官网(仓库是私有的,GitHub Release 无法匿名下载) +DOWNLOAD_BASE="${DOWNLOAD_BASE:-https://getopenstats.com/download}" DIST="${DIST:-dist}" NOTARY_PROFILE="${NOTARY_PROFILE:-QuotaBar}" SIGN_ID="${SIGN_ID:-$(security find-identity -v -p codesigning 2>/dev/null \ @@ -91,7 +92,7 @@ cask "openstats" do version "${VERSION}" sha256 "${SHA256}" - url "https://github.com/${REPO}/releases/download/v#{version}/OpenStats-#{version}.dmg" + url "${DOWNLOAD_BASE}/OpenStats-#{version}.dmg" name "OpenStats" desc "Menu bar system monitor with fan control, keep-awake and cleanup" homepage "https://getopenstats.com" @@ -114,5 +115,5 @@ echo " Homebrew cask:${DIST}/openstats.rb" if [ "${SKIP_NOTARIZE:-0}" = "1" ]; then echo "⚠️ 未公证,仅供本机测试。" else - echo "下一步:创建 GitHub Release v${VERSION} 并上传 DMG,再把 cask 提交到 gentpan/homebrew-tap。" + echo "下一步:./Scripts/publish_release.sh 上传 DMG 到官网并更新 gentpan/homebrew-tap。" fi diff --git a/project.yml b/project.yml index cfef4de..3c40d79 100644 --- a/project.yml +++ b/project.yml @@ -11,8 +11,8 @@ options: settings: base: SWIFT_VERSION: "6.0" - MARKETING_VERSION: "0.1.0" - CURRENT_PROJECT_VERSION: "1" + MARKETING_VERSION: "0.2.0" + CURRENT_PROJECT_VERSION: "2" MACOSX_DEPLOYMENT_TARGET: "14.0" # 本地开发使用 ad-hoc 签名;发布时改为 Developer ID(见 docs/PLAN.md) CODE_SIGN_STYLE: Manual diff --git a/web/index.html b/web/index.html index 6763faf..a1a2522 100644 --- a/web/index.html +++ b/web/index.html @@ -15,9 +15,9 @@ - - - + + + - - + + @@ -108,7 +108,7 @@