Skip to content

Commit c40168c

Browse files
committed
更新构建流程,集成 undici 库并优化请求处理
1 parent a546b75 commit c40168c

File tree

10 files changed

+600
-145
lines changed

10 files changed

+600
-145
lines changed

.github/workflows/beta-pack.yml

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,46 @@ jobs:
9494
name: lx-music-desktop-win_arm64-green
9595
path: build/*win_arm64-green.7z
9696

97+
- name: Generate file MD5
98+
run: |
99+
cd build
100+
Get-FileHash *.exe,*.7z -Algorithm MD5 | Format-List
101+
102+
Windows_7:
103+
name: Windows_7
104+
runs-on: windows-latest
105+
env:
106+
BUILD_WIN7: true
107+
# needs: CheckCode
108+
steps:
109+
- name: Check out git repository
110+
uses: actions/checkout@v4
97111

98-
- name: Install old electron
99-
run: npm install electron@22
112+
- name: Get npm cache directory
113+
shell: pwsh
114+
run: echo "NPM_CACHE=$(npm config get cache)" >> $env:GITHUB_ENV
100115

101-
- name: Install python setuptools
102-
run: pip.exe install setuptools
116+
- name: Setup Node Env
117+
env:
118+
NPM_CACHE: ${{ env.NPM_CACHE }}
119+
uses: ./.github/actions/setup
120+
121+
- name: Prepare win7 undici env
122+
run: |
123+
npm install undici@5
124+
Set-Content -Path .\src\common\utils\request.ts -Value "export * from './request_node16'"
125+
126+
- name: Build src code
127+
env:
128+
BUILD_WIN7: true
129+
run: |
130+
git status --porcelain
131+
npm run build
132+
133+
- name: Prepare win7 electron env
134+
run: |
135+
npm install electron@22
136+
pip.exe install setuptools
103137
104138
- name: Build Package win7 Setup x64
105139
run: npm run pack:win7:setup:x64

.github/workflows/release.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,14 @@ jobs:
9898
NPM_CACHE: ${{ env.NPM_CACHE }}
9999
uses: ./.github/actions/setup
100100

101+
- name: Prepare win7 undici env
102+
run: |
103+
npm install undici@5
104+
Set-Content -Path .\src\common\utils\request.ts -Value "export * from './request_node16'"
105+
101106
- name: Build src code
107+
env:
108+
BUILD_WIN7: true
102109
run: |
103110
git status --porcelain
104111
npm run build

build-config/renderer/webpack.config.prod.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,13 @@ const gitInfo = {
1919
}
2020

2121
try {
22-
if (!execSync('git status --porcelain').toString().trim()) {
22+
let isClean = !execSync('git status --porcelain').toString().trim()
23+
if (process.env.BUILD_WIN7) {
24+
console.warn('BUILD_WIN7 is set, skipping git status check.')
25+
console.log('Workspace status:', execSync('git status --porcelain').toString().trim())
26+
isClean = true
27+
}
28+
if (isClean) {
2329
gitInfo.commit_id = execSync('git log -1 --pretty=format:"%H"').toString().trim()
2430
gitInfo.commit_date = execSync('git log -1 --pretty=format:"%ad" --date=iso-strict').toString().trim()
2531
} else if (process.env.IS_CI) {

package-lock.json

Lines changed: 13 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@
193193
"node-id3": "^0.2.9",
194194
"sortablejs": "^1.15.6",
195195
"tunnel": "^0.0.6",
196+
"undici": "^7.16.0",
196197
"utf-8-validate": "^6.0.5",
197198
"vue": "~3.3.13",
198199
"vue-router": "^4.5.1",

0 commit comments

Comments
 (0)