ci(workflow): 用批处理脚本替换powershell脚本复制libcore文件
简化CI流程中的文件复制操作,使用更简洁的批处理脚本替代原有的powershell脚本
This commit is contained in:
parent
51ed02de1a
commit
b47e0e984e
@ -128,39 +128,8 @@ jobs:
|
|||||||
path: .
|
path: .
|
||||||
|
|
||||||
- name: 🔧 复制 libcore 文件到正确位置并重命名
|
- name: 🔧 复制 libcore 文件到正确位置并重命名
|
||||||
shell: powershell
|
shell: cmd
|
||||||
run: |
|
run: call copy_libcore.bat
|
||||||
Write-Host "📋 复制 libcore 文件..."
|
|
||||||
|
|
||||||
# 创建目标目录
|
|
||||||
New-Item -ItemType Directory -Force -Path libcore/bin
|
|
||||||
|
|
||||||
$exeFiles = Get-ChildItem -Recurse -Filter "HiddifyCli.exe" -ErrorAction SilentlyContinue
|
|
||||||
if ($exeFiles) {
|
|
||||||
$sourceExe = $exeFiles[0].FullName
|
|
||||||
Write-Host "✅ 找到 HiddifyCli.exe: $sourceExe"
|
|
||||||
Write-Host "📝 复制并重命名为 BearVPNCli.exe"
|
|
||||||
Copy-Item $sourceExe libcore/bin/BearVPNCli.exe
|
|
||||||
Write-Host "✅ 重命名完成:HiddifyCli.exe → BearVPNCli.exe"
|
|
||||||
} else {
|
|
||||||
Write-Host "⚠️ 未找到 HiddifyCli.exe"
|
|
||||||
}
|
|
||||||
|
|
||||||
# 复制 libcore.dll
|
|
||||||
$dllFiles = Get-ChildItem -Recurse -Filter "libcore.dll" -ErrorAction SilentlyContinue
|
|
||||||
if ($dllFiles) {
|
|
||||||
$sourceDll = $dllFiles[0].FullName
|
|
||||||
Write-Host "✅ 找到 libcore.dll: $sourceDll"
|
|
||||||
Copy-Item $sourceDll libcore/bin/libcore.dll
|
|
||||||
} else {
|
|
||||||
Write-Host "⚠️ 未找到 libcore.dll"
|
|
||||||
}
|
|
||||||
|
|
||||||
Write-Host ""
|
|
||||||
Write-Host "📄 验证文件:"
|
|
||||||
if (Test-Path libcore/bin) {
|
|
||||||
Get-ChildItem libcore/bin -ErrorAction SilentlyContinue | Format-Table Name, Length
|
|
||||||
}
|
|
||||||
|
|
||||||
- name: Setup Flutter
|
- name: Setup Flutter
|
||||||
uses: subosito/flutter-action@v2
|
uses: subosito/flutter-action@v2
|
||||||
|
|||||||
33
copy_libcore.bat
Normal file
33
copy_libcore.bat
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
@echo off
|
||||||
|
echo 📋 复制 libcore 文件...
|
||||||
|
|
||||||
|
:: 创建目标目录
|
||||||
|
mkdir libcore\bin >nul 2>&1
|
||||||
|
|
||||||
|
:: 查找并复制 HiddifyCli.exe,重命名为 BearVPNCli.exe
|
||||||
|
for /r %%f in (HiddifyCli.exe) do (
|
||||||
|
if exist "%%f" (
|
||||||
|
echo ✅ 找到 HiddifyCli.exe: %%f
|
||||||
|
echo 📝 复制并重命名为 BearVPNCli.exe
|
||||||
|
copy "%%f" libcore\bin\BearVPNCli.exe
|
||||||
|
echo ✅ 重命名完成
|
||||||
|
goto :dll
|
||||||
|
)
|
||||||
|
)
|
||||||
|
echo ⚠️ 未找到 HiddifyCli.exe
|
||||||
|
:dll
|
||||||
|
|
||||||
|
:: 复制 libcore.dll
|
||||||
|
for /r %%f in (libcore.dll) do (
|
||||||
|
if exist "%%f" (
|
||||||
|
echo ✅ 找到 libcore.dll: %%f
|
||||||
|
copy "%%f" libcore\bin\libcore.dll
|
||||||
|
goto :verify
|
||||||
|
)
|
||||||
|
)
|
||||||
|
echo ⚠️ 未找到 libcore.dll
|
||||||
|
:verify
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo 📄 验证文件:
|
||||||
|
if exist libcore\bin dir libcore\bin else echo ⚠️ libcore\bin 目录不存在
|
||||||
Loading…
x
Reference in New Issue
Block a user