Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,24 @@ jobs:
run: |
dotnet build OTAPIXmlDocument.sln -c Release
ota_content=$(cat OTAPI/OTAPI.xml)
ota_path=".nuget/packages/otapi.upcoming/3.1.20/lib/net6.0"
powershell_script=$(cat <<EOL
\$OTA = @"
$ota_content
"@
if (Test-Path -Path "\$env:USERPROFILE/$ota_path/OTAPI.dll") {
New-Item -Path "\$env:USERPROFILE/$ota_path" -Name "OTAPI.xml" -ItemType "file" -Force
Set-Content -Path "\$env:USERPROFILE/$ota_path/OTAPI.xml" -Value \$OTA
Write-Host "OTAPI.xml 文件已安装到: \$env:USERPROFILE/.nuget/packages/otapi.upcoming/3.1.20/lib/net6.0/OTAPI.xml。"
\$dllFiles = Get-ChildItem -Path "\$env:USERPROFILE/.nuget/packages/otapi.upcoming" -Recurse -Filter "OTAPI.dll"

if (\$dllFiles.Count -eq 0) {
Write-Host "未找到任何 OTAPI.dll 文件。"
} else {
Write-Host "OTAPI.dll 文件不存在。"
foreach (\$dllFile in \$dllFiles) {
\$targetDir = \$dllFile.DirectoryName
\$xmlPath = Join-Path -Path \$targetDir -ChildPath "OTAPI.xml"

New-Item -Path \$xmlPath -ItemType "file" -Force | Out-Null
Set-Content -Path \$xmlPath -Value \$OTA

Write-Host "已创建 OTAPI.xml 在: \$xmlPath"
}
}
Pause
EOL
Expand Down
Loading