Is there a way to define a script to be ran before and after a build?
To run script “after” you can use PostProcessBuildAttribute
To run script “before” you can use your own editor-script to build game (see BuildPlayerPipeline)
Here’s the manual page talking about post-process scripts.
Note in that context “script” is an sh or perl script. It seems to reference an example project that I can’t find on the site, though. Maybe you can search the forums for it? Don’t have time to myself right now.