From e7630e98d975be85aed0dfdf59b7c34ff6da65f8 Mon Sep 17 00:00:00 2001 From: lyswhut Date: Sat, 13 Apr 2024 18:46:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=B7=A5=E4=BD=9C=E5=8C=BA?= =?UTF-8?q?=E4=B8=8D=E5=B9=B2=E5=87=80=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/actions/setup/action.yml | 2 -- .github/workflows/beta-pack.yml | 18 +++++++------- .github/workflows/release.yml | 25 ++++++++++---------- build-config/renderer/webpack.config.prod.js | 2 +- 4 files changed, 22 insertions(+), 25 deletions(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index e20a5b94e4..0ee0998ba5 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -15,8 +15,6 @@ runs: with: path: | ${{ env.NPM_CACHE }} - ${{ env.ELECTRON_CACHE }} - ${{ env.ELECTRON_BUILDERCACHE }} key: ${{ runner.os }}-node-modules-cache-${{ hashFiles('package-lock.json') }} restore-keys: | ${{ runner.os }}-node-modules-cache- diff --git a/.github/workflows/beta-pack.yml b/.github/workflows/beta-pack.yml index 96dc8d5696..6ce8dc085c 100644 --- a/.github/workflows/beta-pack.yml +++ b/.github/workflows/beta-pack.yml @@ -42,8 +42,6 @@ jobs: runs-on: windows-latest env: NPM_CACHE: '%APPDATA%\npm-cache' - ELECTRON_CACHE: '%LOCALAPPDATA%\electron\Cache' - ELECTRON_BUILDERCACHE: '%LOCALAPPDATA%\electron-builder\Cache' # needs: CheckCode steps: - name: Check out git repository @@ -53,7 +51,9 @@ jobs: uses: ./.github/actions/setup - name: Build src code - run: npm run build + run: | + git status --porcelain + npm run build - name: Build Package Setup x64 run: npm run pack:win:setup:x64 @@ -129,8 +129,6 @@ jobs: # needs: CheckCode env: NPM_CACHE: $HOME/.npm - ELECTRON_CACHE: $HOME/.cache/electron - ELECTRON_BUILDERCACHE: $HOME/.cache/electron-builder steps: - name: Check out git repository uses: actions/checkout@v4 @@ -142,7 +140,9 @@ jobs: uses: ./.github/actions/setup - name: Build src code - run: npm run build + run: | + git status --porcelain + npm run build - name: Build Package dmg run: | @@ -172,8 +172,6 @@ jobs: runs-on: ubuntu-latest env: NPM_CACHE: $HOME/.npm - ELECTRON_CACHE: $HOME/.cache/electron - ELECTRON_BUILDERCACHE: $HOME/.cache/electron-builder # needs: CheckCode steps: - name: Install package @@ -186,7 +184,9 @@ jobs: uses: ./.github/actions/setup - name: Build src code - run: npm run build + run: | + git status --porcelain + npm run build - name: Build Package deb amd64 run: npm run pack:linux:deb:amd64 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e2685118eb..ccaa2c62b5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -42,8 +42,6 @@ jobs: runs-on: windows-latest env: NPM_CACHE: '%APPDATA%\npm-cache' - ELECTRON_CACHE: '%LOCALAPPDATA%\electron\Cache' - ELECTRON_BUILDERCACHE: '%LOCALAPPDATA%\electron-builder\Cache' # needs: CheckCode steps: - name: Check out git repository @@ -53,7 +51,9 @@ jobs: uses: ./.github/actions/setup - name: Build src code - run: npm run build + run: | + git status --porcelain + npm run build - name: Release package run: | @@ -76,9 +76,6 @@ jobs: runs-on: windows-latest env: NPM_CACHE: '%APPDATA%\npm-cache' - ELECTRON_CACHE: '%LOCALAPPDATA%\electron\Cache' - ELECTRON_BUILDERCACHE: '%LOCALAPPDATA%\electron-builder\Cache' - BUILD_WIN_7: 'true' # needs: CheckCode steps: - name: Check out git repository @@ -88,7 +85,9 @@ jobs: uses: ./.github/actions/setup - name: Build src code - run: npm run build + run: | + git status --porcelain + npm run build - name: Prepare win7 electron env run: | @@ -114,8 +113,6 @@ jobs: runs-on: macos-latest env: NPM_CACHE: $HOME/.npm - ELECTRON_CACHE: $HOME/.cache/electron - ELECTRON_BUILDERCACHE: $HOME/.cache/electron-builder # needs: CheckCode steps: - name: Check out git repository @@ -128,7 +125,9 @@ jobs: uses: ./.github/actions/setup - name: Build src code - run: npm run build + run: | + git status --porcelain + npm run build - name: Release package run: | @@ -148,8 +147,6 @@ jobs: runs-on: ubuntu-latest env: NPM_CACHE: $HOME/.npm - ELECTRON_CACHE: $HOME/.cache/electron - ELECTRON_BUILDERCACHE: $HOME/.cache/electron-builder # needs: CheckCode steps: - name: Install package @@ -162,7 +159,9 @@ jobs: uses: ./.github/actions/setup - name: Build src code - run: npm run build + run: | + git status --porcelain + npm run build - name: Release package run: | diff --git a/build-config/renderer/webpack.config.prod.js b/build-config/renderer/webpack.config.prod.js index 6e7995d952..b63bd0b0f1 100644 --- a/build-config/renderer/webpack.config.prod.js +++ b/build-config/renderer/webpack.config.prod.js @@ -19,7 +19,7 @@ const gitInfo = { } try { - if (!execSync('git status --porcelain').toString().trim() || process.env.BUILD_WIN_7) { + if (!execSync('git status --porcelain').toString().trim()) { gitInfo.commit_id = execSync('git log -1 --pretty=format:"%H"').toString().trim() gitInfo.commit_date = execSync('git log -1 --pretty=format:"%ad" --date=iso-strict').toString().trim() }