game-ci / steam-deploy

Github Action to deploy a game to Steam
MIT License
227 stars 63 forks source link

Exclude Unity's *_DoNotShip directory when uploading to Steam #21

Closed bilalakil closed 2 years ago

bilalakil commented 2 years ago

Context

Unity builds include a folder which you're not supposed to publish to players, maybe with debugging symbols or what not. The folder is suffixed with "_DoNotShip".

A straightforward game.ci pipeline which builds and then deploys will result in that folder being deployed to Steam.

I think it'd be good for this action to automatically exclude it as it's something that, AFAIK, should never be included and can be handled automatically (just like the "*.pdb" exclusion that's already hardcoded in here).

Suggested solution

I think using Steamwork's FileExclusion thingo that's very briefly described here is the way to go but I personally couldn't get it working - dunno what I'm doing wrong. Maybe more eyes on the problem can figure it out?

Two exclusions I tried (separately) were:

  "FileExclusion" "./$currentDepotPath/${currentDepotPath}_BurstDebugInformation_DoNotShip*"
  "FileExclusion" "${currentDepotPath}_BurstDebugInformation_DoNotShip*"

This evaluated to:

  "FileExclusion" "./StandaloneWindows64/StandaloneWindows64_BurstDebugInformation_DoNotShip*"
  "FileExclusion" "StandaloneWindows64_BurstDebugInformation_DoNotShip*"

and this exactly matches the name from what I see after downloading the game in Steam... Not sure why it's not working.

Considered alternatives

If we can't get FileExclusion working then we could go more hacky and move the folder out, do the upload, and then replace it?

Additional details

Nothing further to add.

bilalakil commented 2 years ago

I did a more extensive test of FileExclusion stuff and one of all these actually did the job:

  "FileExclusion" "${currentDepotPath}_BurstDebugInformation_DoNotShip*"
  "FileExclusion" "./${currentDepotPath}_BurstDebugInformation_DoNotShip*"
  "FileExclusion" ".\${currentDepotPath}_BurstDebugInformation_DoNotShip*"
  "FileExclusion" "./$currentDepotPath/${currentDepotPath}_BurstDebugInformation_DoNotShip*"
  "FileExclusion" ".\$currentDepotPath\${currentDepotPath}_BurstDebugInformation_DoNotShip*"
  "FileExclusion" "$currentDepotPath/${currentDepotPath}_BurstDebugInformation_DoNotShip*"
  "FileExclusion" "$currentDepotPath\${currentDepotPath}_BurstDebugInformation_DoNotShip*"

Now to figure out which one 😆 But yeah, this can work.

bilalakil commented 2 years ago

If I can figure out which one, is this something you'd like me to make a PR for, or are there any other concerns to be addressed first?

webbertakken commented 2 years ago

As far as I can see there wouldn't be anyone who'd want to ship this. I think it would be worth documenting which paths are excluded. Probably paths for UE will also need to be added in the future, so a section about it would be good i think.

Already deleting the folder in a previous step, like in builder for example, also wouldn't make much sense I think, as artifacts might not be exclusively used for deployment, but also for debugging and maybe other purposes as well.

bilalakil commented 2 years ago

We will soon find out which one works 😛

image

Ok I'll add an Excluded Files section to the README and make a PR for this.