Skip to content

Commit

Permalink
修复工作区不干净的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
lyswhut committed Apr 13, 2024
1 parent 9779c1e commit e7630e9
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 25 deletions.
2 changes: 0 additions & 2 deletions .github/actions/setup/action.yml
Expand Up @@ -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-
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/beta-pack.yml
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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: |
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
25 changes: 12 additions & 13 deletions .github/workflows/release.yml
Expand Up @@ -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
Expand All @@ -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: |
Expand All @@ -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
Expand All @@ -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: |
Expand All @@ -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
Expand All @@ -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: |
Expand All @@ -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
Expand All @@ -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: |
Expand Down
2 changes: 1 addition & 1 deletion build-config/renderer/webpack.config.prod.js
Expand Up @@ -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()
}
Expand Down

0 comments on commit e7630e9

Please sign in to comment.