chore: update

This commit is contained in:
YuleBest committed 2026-04-10 03:39:01 +08:00
1 parent c35e1cb6ee
commit 2abc597fad
3 files changed
+14 -22

No files matched your search

+10 -11
View File
@@ -66,23 +66,22 @@ jobs:
- name: Package module
run: node build-module.js
# ── 4. 解压到暂存目录并命名 artifact ────────────────────────────────
# upload-artifact 会对上传路径再套一层 zip;通过解压到 staging/ 再上传,
# 让 upload-artifact 的 zip 本身就是可直接刷入的模块包,避免双重嵌套。
- name: Prepare staging directory
# ── 4. 重命名 zip 加入 commit 短哈希 ─────────────────────────────────
- name: Rename zip with commit hash
id: names
run: |
VERSION=$(grep '^version=' module.prop | cut -d= -f2 | tr -d '[:space:]')
SHORT_SHA=$(git rev-parse --short HEAD)
ARTIFACT="LuminPro_${VERSION}-${SHORT_SHA}.zip"
mkdir staging
cd staging && unzip "../LuminPro_${VERSION}.zip"
echo "artifact=$ARTIFACT" >> "$GITHUB_OUTPUT"
FINAL="LuminPro_${VERSION}-${SHORT_SHA}.zip"
mv "LuminPro_${VERSION}.zip" "$FINAL"
echo "zip=$FINAL" >> "$GITHUB_OUTPUT"
# ── 5. 上传 artifact ─────────────────────────────────────────────────
# ── 5. 上传 artifact(单个 zip 文件) ────────────────────────────────
# upload-artifact 上传单个文件时仍会套一层 zip;通过 gh run download 下载
# 后得到的即是模块 zip,直接可刷入,无需二次解压。
- name: Upload module zip
uses: actions/upload-artifact@v4
with:
name: ${{ steps.names.outputs.artifact }}
path: staging/
name: ${{ steps.names.outputs.zip }}
path: ${{ steps.names.outputs.zip }}
if-no-files-found: error
+4
View File
@@ -3,6 +3,7 @@ dist/
.vite/
*.log
*.zip
.dist
# 屏蔽 webroot 下的所有文件,但保留目录本身
webroot/*
@@ -10,3 +11,6 @@ webroot/*
# rust
rust/target/
# 本地脚本
deploy.ps1
-11
View File
@@ -6,10 +6,8 @@ MODDIR="${0%/*/*}"
CONFIG_FILE="$MODDIR/config/config.json"
JQ="$MODDIR/bin/jq"
PID_DIR="$MODDIR/pid"
flag_file="$PID_DIR/up.flag"
stop_file="$PID_DIR/stop.flag"
log_file="$MODDIR/service.log"
pause_file="$PID_DIR/daemon.pause"
DEFAULT_NOW_BRI_FILE="/sys/class/backlight/panel0-backlight/brightness"
@@ -52,8 +50,6 @@ if [ -f "$stop_file" ]; then
exit 0
fi
touch "$flag_file"
# 读取配置
ui_max_bri="$(get_cfg ui_max_bri 0)"
max_bri="$(get_cfg max_bri 0)"
@@ -123,7 +119,6 @@ CHECK_BRI() {
MAIN() {
if IS_SLEEP_TIME; then
_log "处于休眠时段 ($sleep_start-$sleep_end),跳过提升" "INFO"
rm -f "$flag_file"
return
fi
@@ -132,7 +127,6 @@ MAIN() {
mode="$(settings get system screen_brightness_mode 2>/dev/null)"
if [ "$mode" = "1" ]; then
_log "自动亮度已启用,跳过提升" "INFO"
rm -f "$flag_file"
return
fi
fi
@@ -149,7 +143,6 @@ MAIN() {
'.blacklist_apps | map(. == $f or . == $a) | any' \
"$CONFIG_FILE" >/dev/null 2>&1; then
_log "当前前台 ($current_focus) 在黑名单中,跳过提升" "INFO"
rm -f "$flag_file"
return
fi
fi
@@ -163,7 +156,6 @@ MAIN() {
now="$(date +%s)"
if awk "BEGIN{exit !(($now - $flag_time) < 2)}" 2>/dev/null; then
_log "HDR 冷却期内,跳过提升" "INFO"
rm -f "$flag_file"
return
else
rm -f "$hdr_flag_file"
@@ -184,7 +176,6 @@ MAIN() {
if awk "BEGIN{exit !($hdr_ratio_rounded > 1.00)}" 2>/dev/null; then
_log "检测到 HDR 内容 (比率: $hdr_ratio_rounded),跳过提升" "INFO"
date +%s >"$hdr_flag_file"
rm -f "$flag_file"
return
fi
fi
@@ -192,8 +183,6 @@ MAIN() {
_log "正在检测亮度变化..." "INFO"
CHECK_BRI
rm -f "$flag_file"
}
MAIN