colyseus / colyseus-unity-sdk

⚔ Colyseus Multiplayer SDK for Unity
https://docs.colyseus.io/getting-started/unity-sdk/
MIT License
371 stars 100 forks source link

Error creating .unitypackage (GitHub Workflow) #191

Closed endel closed 2 years ago

endel commented 2 years ago

Since https://github.com/colyseus/colyseus-unity-sdk/pull/190, this error started happening when bumping the version on package.json:

Error: EISDIR: illegal operation on a directory, copyfile 'Assets/Colyseus/Runtime/GameDevWare.Serialization/Serializers' -> 'tempFolderxYvGXL/archtemp/c809db31b7a940809cc167711d5bbe55/asset'
    at Object.copyFileSync (fs.js:1907:3)
    at /home/runner/work/_actions/pCYSl5EDgo/create-unitypackage/master/node_modules/unitypackage/dist/index.js:72:30
    at FSReqCallback.oncomplete (fs.js:156:23) {
  errno: -21,
  syscall: 'copyfile',
  code: 'EISDIR',
  path: 'Assets/Colyseus/Runtime/GameDevWare.Serialization/Serializers',
  dest: 'tempFolderxYvGXL/archtemp/c809db31b7a940809cc167711d5bbe55/asset'
}

The issue seems to be coming from the unitypackage NPM module, at this line: https://github.com/pCYSl5EDgo/unitypackage/blob/c164da80cc54c7fdd452c83cc0eec3b0b5ded21a/src/index.ts#L83

Apparently, unitypackage tries to call copyFileSync() to copy "GameDevWare.Serialization/Serializers" as it were a file, but it is a directory.

lpsandaruwan commented 2 years ago

Hi @endel

This PR should fix Unity packaging issue, https://github.com/colyseus/colyseus-unity-sdk/pull/192 I have tested the same scenarios in these workflows, https://github.com/lpsandaruwan/colyseus-unity-sdk/actions

Previously I opened the PR from Windows platform, might have to do something with Windows file encoding. I'm not sure about the reason. But replacing assets with Unix worked.