From 8741c441154ca4a480df731af6b32d98335b5344 Mon Sep 17 00:00:00 2001 From: SukkaW Date: Sun, 15 Jun 2025 21:50:05 +0800 Subject: [PATCH] Remove unsued file in CI cache & Bump CI deps --- .github/workflows/main.yml | 4 ++-- Build/index.ts | 10 +++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c9fe6928..7c64cca0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -141,10 +141,10 @@ jobs: name: Deploy to Cloudflare Pages if: github.ref == 'refs/heads/master' runs-on: ubuntu-24.04-arm - # matrix is a tricky way to define a variable directly in the jon yaml + # matrix is a tricky way to define a variable directly in the action yaml strategy: matrix: - wranglerVersion: ['3.114.6'] + wranglerVersion: ['3.114.9'] steps: - name: Get NPM cache directory path id: npm_cache_path diff --git a/Build/index.ts b/Build/index.ts index dd860052..56e521dd 100644 --- a/Build/index.ts +++ b/Build/index.ts @@ -1,6 +1,7 @@ import process from 'node:process'; import os from 'node:os'; import fs from 'node:fs'; +import fsp from 'node:fs/promises'; import { downloadPreviousBuild } from './download-previous-build'; import { buildCommon } from './build-common'; @@ -28,7 +29,7 @@ import { buildCloudMounterRules } from './build-cloudmounter-rules'; import { createSpan, printTraceResult, whyIsNodeRunning } from './trace'; import { buildDeprecateFiles } from './build-deprecate-files'; import path from 'node:path'; -import { ROOT_DIR } from './constants/dir'; +import { CACHE_DIR, ROOT_DIR } from './constants/dir'; import { isCI } from 'ci-info'; process.on('uncaughtException', (error) => { @@ -40,6 +41,12 @@ process.on('unhandledRejection', (reason) => { process.exit(1); }); +const removesFiles = [ + path.join(CACHE_DIR, '.cache.db'), + path.join(CACHE_DIR, '.cache.db-shm'), + path.join(CACHE_DIR, '.cache.db-wal') +]; + const buildFinishedLock = path.join(ROOT_DIR, '.BUILD_FINISHED'); (async () => { @@ -82,6 +89,7 @@ const buildFinishedLock = path.join(ROOT_DIR, '.BUILD_FINISHED'); const buildCommonPromise = downloadPreviousBuildPromise.then(() => buildCommon(rootSpan)); await Promise.all([ + ...removesFiles.map(file => fsp.rm(file, { force: true })), downloadPreviousBuildPromise, buildCommonPromise, downloadPreviousBuildPromise.then(() => buildRejectIPList(rootSpan)),