修复工作区不干净的问题

pull/1853/head
lyswhut 2024-04-13 18:46:36 +08:00
parent 9779c1ebee
commit e7630e98d9
4 changed files with 22 additions and 25 deletions

View File

@ -15,8 +15,6 @@ runs:
with: with:
path: | path: |
${{ env.NPM_CACHE }} ${{ env.NPM_CACHE }}
${{ env.ELECTRON_CACHE }}
${{ env.ELECTRON_BUILDERCACHE }}
key: ${{ runner.os }}-node-modules-cache-${{ hashFiles('package-lock.json') }} key: ${{ runner.os }}-node-modules-cache-${{ hashFiles('package-lock.json') }}
restore-keys: | restore-keys: |
${{ runner.os }}-node-modules-cache- ${{ runner.os }}-node-modules-cache-

View File

@ -42,8 +42,6 @@ jobs:
runs-on: windows-latest runs-on: windows-latest
env: env:
NPM_CACHE: '%APPDATA%\npm-cache' NPM_CACHE: '%APPDATA%\npm-cache'
ELECTRON_CACHE: '%LOCALAPPDATA%\electron\Cache'
ELECTRON_BUILDERCACHE: '%LOCALAPPDATA%\electron-builder\Cache'
# needs: CheckCode # needs: CheckCode
steps: steps:
- name: Check out git repository - name: Check out git repository
@ -53,7 +51,9 @@ jobs:
uses: ./.github/actions/setup uses: ./.github/actions/setup
- name: Build src code - name: Build src code
run: npm run build run: |
git status --porcelain
npm run build
- name: Build Package Setup x64 - name: Build Package Setup x64
run: npm run pack:win:setup:x64 run: npm run pack:win:setup:x64
@ -129,8 +129,6 @@ jobs:
# needs: CheckCode # needs: CheckCode
env: env:
NPM_CACHE: $HOME/.npm NPM_CACHE: $HOME/.npm
ELECTRON_CACHE: $HOME/.cache/electron
ELECTRON_BUILDERCACHE: $HOME/.cache/electron-builder
steps: steps:
- name: Check out git repository - name: Check out git repository
uses: actions/checkout@v4 uses: actions/checkout@v4
@ -142,7 +140,9 @@ jobs:
uses: ./.github/actions/setup uses: ./.github/actions/setup
- name: Build src code - name: Build src code
run: npm run build run: |
git status --porcelain
npm run build
- name: Build Package dmg - name: Build Package dmg
run: | run: |
@ -172,8 +172,6 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
env: env:
NPM_CACHE: $HOME/.npm NPM_CACHE: $HOME/.npm
ELECTRON_CACHE: $HOME/.cache/electron
ELECTRON_BUILDERCACHE: $HOME/.cache/electron-builder
# needs: CheckCode # needs: CheckCode
steps: steps:
- name: Install package - name: Install package
@ -186,7 +184,9 @@ jobs:
uses: ./.github/actions/setup uses: ./.github/actions/setup
- name: Build src code - name: Build src code
run: npm run build run: |
git status --porcelain
npm run build
- name: Build Package deb amd64 - name: Build Package deb amd64
run: npm run pack:linux:deb:amd64 run: npm run pack:linux:deb:amd64

View File

@ -42,8 +42,6 @@ jobs:
runs-on: windows-latest runs-on: windows-latest
env: env:
NPM_CACHE: '%APPDATA%\npm-cache' NPM_CACHE: '%APPDATA%\npm-cache'
ELECTRON_CACHE: '%LOCALAPPDATA%\electron\Cache'
ELECTRON_BUILDERCACHE: '%LOCALAPPDATA%\electron-builder\Cache'
# needs: CheckCode # needs: CheckCode
steps: steps:
- name: Check out git repository - name: Check out git repository
@ -53,7 +51,9 @@ jobs:
uses: ./.github/actions/setup uses: ./.github/actions/setup
- name: Build src code - name: Build src code
run: npm run build run: |
git status --porcelain
npm run build
- name: Release package - name: Release package
run: | run: |
@ -76,9 +76,6 @@ jobs:
runs-on: windows-latest runs-on: windows-latest
env: env:
NPM_CACHE: '%APPDATA%\npm-cache' NPM_CACHE: '%APPDATA%\npm-cache'
ELECTRON_CACHE: '%LOCALAPPDATA%\electron\Cache'
ELECTRON_BUILDERCACHE: '%LOCALAPPDATA%\electron-builder\Cache'
BUILD_WIN_7: 'true'
# needs: CheckCode # needs: CheckCode
steps: steps:
- name: Check out git repository - name: Check out git repository
@ -88,7 +85,9 @@ jobs:
uses: ./.github/actions/setup uses: ./.github/actions/setup
- name: Build src code - name: Build src code
run: npm run build run: |
git status --porcelain
npm run build
- name: Prepare win7 electron env - name: Prepare win7 electron env
run: | run: |
@ -114,8 +113,6 @@ jobs:
runs-on: macos-latest runs-on: macos-latest
env: env:
NPM_CACHE: $HOME/.npm NPM_CACHE: $HOME/.npm
ELECTRON_CACHE: $HOME/.cache/electron
ELECTRON_BUILDERCACHE: $HOME/.cache/electron-builder
# needs: CheckCode # needs: CheckCode
steps: steps:
- name: Check out git repository - name: Check out git repository
@ -128,7 +125,9 @@ jobs:
uses: ./.github/actions/setup uses: ./.github/actions/setup
- name: Build src code - name: Build src code
run: npm run build run: |
git status --porcelain
npm run build
- name: Release package - name: Release package
run: | run: |
@ -148,8 +147,6 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
env: env:
NPM_CACHE: $HOME/.npm NPM_CACHE: $HOME/.npm
ELECTRON_CACHE: $HOME/.cache/electron
ELECTRON_BUILDERCACHE: $HOME/.cache/electron-builder
# needs: CheckCode # needs: CheckCode
steps: steps:
- name: Install package - name: Install package
@ -162,7 +159,9 @@ jobs:
uses: ./.github/actions/setup uses: ./.github/actions/setup
- name: Build src code - name: Build src code
run: npm run build run: |
git status --porcelain
npm run build
- name: Release package - name: Release package
run: | run: |

View File

@ -19,7 +19,7 @@ const gitInfo = {
} }
try { 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_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() gitInfo.commit_date = execSync('git log -1 --pretty=format:"%ad" --date=iso-strict').toString().trim()
} }