mirror of
https://github.com/fankes/komari-theme-purcarte.git
synced 2025-10-19 03:49:22 +08:00
perf: 尝试优化主题版本号更新方案
This commit is contained in:
20
.github/workflows/build.yaml
vendored
20
.github/workflows/build.yaml
vendored
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user