From 32de293ccf9bd322c1be462421f4e7c7fcb6eb64 Mon Sep 17 00:00:00 2001 From: Montia37 Date: Wed, 27 Aug 2025 16:54:17 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E5=B0=9D=E8=AF=95=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E4=B8=BB=E9=A2=98=E7=89=88=E6=9C=AC=E5=8F=B7=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E6=96=B9=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yaml | 20 ++++++++++ .github/workflows/development.yaml | 60 ------------------------------ komari-theme.json | 2 +- 3 files changed, 21 insertions(+), 61 deletions(-) delete mode 100644 .github/workflows/development.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index f9204c8..8259a4f 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -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 diff --git a/.github/workflows/development.yaml b/.github/workflows/development.yaml deleted file mode 100644 index a355f8e..0000000 --- a/.github/workflows/development.yaml +++ /dev/null @@ -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 }} diff --git a/komari-theme.json b/komari-theme.json index 64dfa99..ea60676 100644 --- a/komari-theme.json +++ b/komari-theme.json @@ -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",