mirror of
https://github.com/fankes/komari-theme-purcarte.git
synced 2025-10-18 03:19:23 +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
|
||||
|
||||
|
60
.github/workflows/development.yaml
vendored
60
.github/workflows/development.yaml
vendored
@@ -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 }}
|
@@ -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",
|
||||
|
Reference in New Issue
Block a user