Skip to content

Commit 19cfff0

Browse files
committed
打包 libnode
1 parent df90705 commit 19cfff0

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

.github/workflows/build_nuget.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,33 @@ jobs:
9494
done
9595
done
9696
97+
# puerts\unity\native\papi-nodejs\.backends\papi-nodejs\lib\Linux\libnode.so.93
98+
# puerts\unity\native\papi-nodejs\.backends\papi-nodejs\lib\Win64\libnode.dll
99+
# puerts\unity\native\papi-nodejs\.backends\papi-nodejs\lib\macOS\libnode.93.dylib
100+
- name: Process libraries dependencies
101+
run: |
102+
# Move libnode libraries to build directories
103+
$backends = @("papi-nodejs")
104+
$platforms = @(
105+
@{src="Linux"; pattern="libnode.so.*"; dest="linux_x64"},
106+
@{src="Win64"; pattern="libnode.dll"; dest="win_x64"},
107+
@{src="macOS"; pattern="libnode.*.dylib"; dest="osx_auto"}
108+
)
109+
110+
foreach ($backend in $backends) {
111+
foreach ($platform in $platforms) {
112+
$srcPath = "unity/native/$backend/.backends/$backend/lib/$($platform.src)/$($platform.pattern)"
113+
$destPathPattern = "unity/native/$backend/build_$($platform.dest)_*/Release/"
114+
$destPath = Get-ChildItem -Path $destPathPattern -Directory -ErrorAction SilentlyContinue | Select-Object -First 1 -ExpandProperty FullName
115+
if ($destPath) {
116+
Get-ChildItem -Path $srcPath -ErrorAction SilentlyContinue | ForEach-Object {
117+
Move-Item -Path $_.FullName -Destination $destPath -Force
118+
}
119+
}
120+
}
121+
}
122+
shell: pwsh
123+
97124
- name: Upload all native artifacts
98125
uses: actions/upload-artifact@v4
99126
with:

0 commit comments

Comments
 (0)