Skip to content

Commit 11b7f29

Browse files
committed
feat(build): 添加FeaturePacks到构建流程
- 在Windows构建中添加PowerShell脚本复制http_pack、bili_pack和ffmpeg_pack到分发目录 - 在macOS构建中添加bash脚本将FeaturePacks复制到应用Bundle的Contents/MacOS/features目录 - 在Linux构建中添加bash脚本将FeaturePacks复制到分发目录的features子目录 - 对于所有平台实现FeaturePacks的覆盖复制逻辑,确保每次构建都是最新的功能包 - 统一跨平台的FeaturePacks部署策略,支持http、bilibili和ffmpeg相关功能模块
1 parent 044ae2e commit 11b7f29

File tree

4 files changed

+90
-0
lines changed

4 files changed

+90
-0
lines changed

.github/workflows/build.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,21 @@ jobs:
3838
python deploy.py
3939
mv dist/Ghost-Downloader-3.dist dist/Ghost-Downloader-3-Unsigned.dist
4040
41+
- name: Copy FeaturePacks
42+
shell: pwsh
43+
run: |
44+
$targetRoot = "dist/Ghost-Downloader-3-Unsigned.dist/features"
45+
New-Item -ItemType Directory -Force -Path $targetRoot | Out-Null
46+
47+
foreach ($pack in @("http_pack", "bili_pack", "ffmpeg_pack")) {
48+
$source = Join-Path "features" $pack
49+
$target = Join-Path $targetRoot $pack
50+
if (Test-Path $target) {
51+
Remove-Item -Recurse -Force $target
52+
}
53+
Copy-Item -Recurse -Force $source $target
54+
}
55+
4156
- name: upload-unsigned-artifact
4257
id: upload-unsigned-artifact
4358
uses: actions/upload-artifact@v4
@@ -120,6 +135,16 @@ jobs:
120135
mv "dist/Ghost-Downloader-3.app" "dist/Ghost Downloader.app"
121136
mv "resources/修复软件损坏" "dist/修复软件损坏"
122137
138+
- name: Copy FeaturePacks
139+
run: |
140+
target_root="dist/Ghost Downloader.app/Contents/MacOS/features"
141+
mkdir -p "$target_root"
142+
143+
for pack in http_pack bili_pack ffmpeg_pack; do
144+
rm -rf "$target_root/$pack"
145+
cp -R "features/$pack" "$target_root/$pack"
146+
done
147+
123148
- name: Create DMG
124149
run: |
125150
ln -s /Applications dist/Applications
@@ -184,6 +209,16 @@ jobs:
184209
mv "dist/Ghost-Downloader-3.app" "dist/Ghost Downloader.app"
185210
mv "resources/修复软件损坏" "dist/修复软件损坏"
186211
212+
- name: Copy FeaturePacks
213+
run: |
214+
target_root="dist/Ghost Downloader.app/Contents/MacOS/features"
215+
mkdir -p "$target_root"
216+
217+
for pack in http_pack bili_pack ffmpeg_pack; do
218+
rm -rf "$target_root/$pack"
219+
cp -R "features/$pack" "$target_root/$pack"
220+
done
221+
187222
- name: Reinstall openssl libs
188223
run: |
189224
brew install openssl@3
@@ -231,6 +266,16 @@ jobs:
231266
python deploy.py
232267
chmod +x "dist/Ghost-Downloader-3.dist/Ghost-Downloader-3.bin"
233268
269+
- name: Copy FeaturePacks
270+
run: |
271+
target_root="dist/Ghost-Downloader-3.dist/features"
272+
mkdir -p "$target_root"
273+
274+
for pack in http_pack bili_pack ffmpeg_pack; do
275+
rm -rf "$target_root/$pack"
276+
cp -R "features/$pack" "$target_root/$pack"
277+
done
278+
234279
- name: Tar the contents of Ghost-Downloader
235280
shell: pwsh
236281
run: |

.github/workflows/build_Linux.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,16 @@ jobs:
3434
rm -rf version.txt
3535
python deploy.py
3636
37+
- name: Copy FeaturePacks
38+
run: |
39+
target_root="dist/Ghost-Downloader-3.dist/features"
40+
mkdir -p "$target_root"
41+
42+
for pack in http_pack bili_pack ffmpeg_pack; do
43+
rm -rf "$target_root/$pack"
44+
cp -R "features/$pack" "$target_root/$pack"
45+
done
46+
3747
- name: Upload artifacts
3848
uses: actions/upload-artifact@v4
3949
with:

.github/workflows/build_Windows.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,21 @@ jobs:
5050
del version.txt
5151
python deploy.py
5252
53+
- name: Copy FeaturePacks
54+
shell: pwsh
55+
run: |
56+
$targetRoot = "dist/Ghost-Downloader-3.dist/features"
57+
New-Item -ItemType Directory -Force -Path $targetRoot | Out-Null
58+
59+
foreach ($pack in @("http_pack", "bili_pack", "ffmpeg_pack")) {
60+
$source = Join-Path "features" $pack
61+
$target = Join-Path $targetRoot $pack
62+
if (Test-Path $target) {
63+
Remove-Item -Recurse -Force $target
64+
}
65+
Copy-Item -Recurse -Force $source $target
66+
}
67+
5368
- name: Prepare For Sign
5469
if: ${{ github.event.inputs.sign_artifact == 'true' }}
5570
run: |

.github/workflows/build_macOS.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,16 @@ jobs:
3737
mv "dist/Ghost-Downloader-3.app" "dist/Ghost Downloader.app"
3838
mv "resources/修复软件损坏" "dist/修复软件损坏"
3939
40+
- name: Copy FeaturePacks
41+
run: |
42+
target_root="dist/Ghost Downloader.app/Contents/MacOS/features"
43+
mkdir -p "$target_root"
44+
45+
for pack in http_pack bili_pack ffmpeg_pack; do
46+
rm -rf "$target_root/$pack"
47+
cp -R "features/$pack" "$target_root/$pack"
48+
done
49+
4050
- name: Create DMG
4151
run: |
4252
ln -s /Applications dist/Applications
@@ -101,6 +111,16 @@ jobs:
101111
mv "dist/Ghost-Downloader-3.app" "dist/Ghost Downloader.app"
102112
mv "resources/修复软件损坏" "dist/修复软件损坏"
103113
114+
- name: Copy FeaturePacks
115+
run: |
116+
target_root="dist/Ghost Downloader.app/Contents/MacOS/features"
117+
mkdir -p "$target_root"
118+
119+
for pack in http_pack bili_pack ffmpeg_pack; do
120+
rm -rf "$target_root/$pack"
121+
cp -R "features/$pack" "$target_root/$pack"
122+
done
123+
104124
- name: Reinstall openssl libs
105125
run: |
106126
brew install openssl@3

0 commit comments

Comments
 (0)