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

View File

@@ -1,60 +0,0 @@
name: Development Environment
on:
# Temporarily disabled
# push:
# branches: [main]
# pull_request:
# branches: [main]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
- name: Install dependencies
run: npm install
- name: Build project
run: npm run build
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist
deploy:
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: dist
- name: Setup SSH Key
uses: webfactory/ssh-agent@v0.8.0
with:
ssh-private-key: ${{ secrets.PRODUCTION_SSH_KEY }}
- name: Add host to known hosts
run: |
mkdir -p ~/.ssh
ssh-keyscan -H ${{ vars.PRODUCTION_SERVER }} >> ~/.ssh/known_hosts
- name: Deploy to production server
run: |
rsync -avz --delete dist/ root@${{ vars.PRODUCTION_SERVER }}:${{ vars.PRODUCTION_DIR }}

View File

@@ -2,7 +2,7 @@
"name": "Komari Theme PurCart",
"short": "PurCarte",
"description": "A frosted glass theme for Komari",
"version": "1.0.7",
"version": "tags:VERSION",
"author": "Montia & Gemini",
"url": "https://github.com/Montia37/Komari-theme-purcarte",
"preview": "preview.png",