Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
16ece31d57 | ||
|
|
8d8b201498 | ||
|
|
5744bf5585 |
@@ -20,26 +20,25 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Determine Version Tag
|
||||
- name: Determine Version Tag & Generate Notes
|
||||
id: versioning
|
||||
run: |
|
||||
PREV_TAG=$(git tag -l "v*" --sort=-v:refname | head -n1)
|
||||
echo "Previous tag: $PREV_TAG"
|
||||
|
||||
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
|
||||
TAG="${GITHUB_REF#refs/tags/}"
|
||||
else
|
||||
# 获取最新语义化版本 tag (例如 v1.1.0)
|
||||
LATEST_TAG=$(git tag -l "v*" --sort=-v:refname | head -n1)
|
||||
if [ -z "$LATEST_TAG" ]; then
|
||||
LATEST_TAG="v1.0.0"
|
||||
fi
|
||||
# 去除前缀 v
|
||||
VER_NUM="${LATEST_TAG#v}"
|
||||
# 拆解 MAJOR.MINOR.PATCH
|
||||
if [ -z "$PREV_TAG" ]; then
|
||||
TAG="v1.0.0"
|
||||
else
|
||||
VER_NUM="${PREV_TAG#v}"
|
||||
IFS='.' read -r MAJOR MINOR PATCH <<< "$VER_NUM"
|
||||
PATCH=$((PATCH + 1))
|
||||
TAG="v${MAJOR}.${MINOR}.${PATCH}"
|
||||
fi
|
||||
echo "Auto incremented patch version to $TAG"
|
||||
|
||||
# 打上本地 tag 并推送到远程
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git tag "$TAG"
|
||||
@@ -47,6 +46,25 @@ jobs:
|
||||
fi
|
||||
echo "tag=$TAG" >> $GITHUB_OUTPUT
|
||||
|
||||
# 生成详细的 Release Changelog 正文
|
||||
cat << NOTES > release_notes.md
|
||||
### 🚀 What's Changed in ${TAG}
|
||||
|
||||
NOTES
|
||||
|
||||
if [ -n "$PREV_TAG" ]; then
|
||||
git log "${PREV_TAG}..HEAD" --pretty=format:"- %s (%h by @%an)" >> release_notes.md
|
||||
else
|
||||
git log -n 10 --pretty=format:"- %s (%h by @%an)" >> release_notes.md
|
||||
fi
|
||||
|
||||
echo "" >> release_notes.md
|
||||
echo "" >> release_notes.md
|
||||
if [ -n "$PREV_TAG" ]; then
|
||||
echo "**Full Changelog**: https://github.com/${{ github.repository }}/compare/${PREV_TAG}...${TAG}" >> release_notes.md
|
||||
fi
|
||||
cat release_notes.md
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
@@ -73,6 +91,6 @@ jobs:
|
||||
with:
|
||||
tag_name: ${{ steps.versioning.outputs.tag }}
|
||||
name: Release ${{ steps.versioning.outputs.tag }}
|
||||
body_path: release_notes.md
|
||||
files: |
|
||||
dist/*
|
||||
generate_release_notes: true
|
||||
|
||||
@@ -38,6 +38,8 @@ async function loadDevices(){
|
||||
const p = d.profile || {};
|
||||
const role = p.role || "APPLICATION";
|
||||
const isOnline = d.status === "online";
|
||||
const statusText = isOnline ? "在线" : "离线";
|
||||
const archOs = (d.arch || d.os) ? `${esc(d.arch||"")}/${esc(d.os||"")} · ` : "";
|
||||
const cpuStr = p.cpu_cores ? `${p.cpu_cores}C · ${p.cpu_usage_percent ?? 0}%` : '-';
|
||||
const loadStr = p.load_1m !== undefined ? p.load_1m.toFixed(2) : '-';
|
||||
const memStr = p.mem_available ? `${p.mem_available} (${p.mem_percent}%)` : (p.mem_percent !== undefined ? `${p.mem_percent}%` : '-');
|
||||
|
||||
@@ -38,6 +38,8 @@ async function loadDevices(){
|
||||
const p = d.profile || {};
|
||||
const role = p.role || "APPLICATION";
|
||||
const isOnline = d.status === "online";
|
||||
const statusText = isOnline ? "在线" : "离线";
|
||||
const archOs = (d.arch || d.os) ? `${esc(d.arch||"")}/${esc(d.os||"")} · ` : "";
|
||||
const cpuStr = p.cpu_cores ? `${p.cpu_cores}C · ${p.cpu_usage_percent ?? 0}%` : '-';
|
||||
const loadStr = p.load_1m !== undefined ? p.load_1m.toFixed(2) : '-';
|
||||
const memStr = p.mem_available ? `${p.mem_available} (${p.mem_percent}%)` : (p.mem_percent !== undefined ? `${p.mem_percent}%` : '-');
|
||||
|
||||
Reference in New Issue
Block a user