perf: 尝试优化主题版本号更新方案

This commit is contained in:
Montia37
2025-08-27 16:54:17 +08:00
parent 018e15d78c
commit 32de293ccf
3 changed files with 21 additions and 61 deletions

View File

@@ -35,6 +35,26 @@ jobs:
- name: Update theme configuration
run: |
# Extract version from tag (remove 'v' prefix)
VERSION=${GITHUB_REF_NAME#v}
# Validate semantic version format (X.Y.Z)
if ! echo "$VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+$'; then
echo "Error: Version '$VERSION' is not a valid semantic version (X.Y.Z format)"
echo "Expected format: X.Y.Z (e.g., 1.2.3)"
exit 1
fi
echo "Valid semantic version detected: $VERSION"
echo "VERSION=${VERSION}" >> $GITHUB_ENV
# Update komari-theme.json with new version
jq --arg version "$VERSION" \
'.version = $version' \
komari-theme.json > komari-theme-updated.json
mv komari-theme-updated.json komari-theme.json
echo "Updated theme configuration:"
cat komari-theme.json