Basic Local Unity Build Pipeline
Here's my "local build pipeline" for Unity. It consists of a C# Editor script defining the various build targets and a convenient
BuildAll method, and a shell script that invokes the latter method.
Running headless builds like this is a lot less work than switching platforms and triggering builds manually in the editor, and it is most definitely faster than using the god-awfully slow Unity Cloud Build to do it. (In my game, running this local pipeline produces builds for all my targeted platforms in just over 7 minutes on my Macbook Pro, while Unity Cloud Build would often take longer than an hour.)
As you can see from the code, it will read the secrets required for Play Store publishing from the environment. Ideally, in the future it will also source the Android build number like this (or maybe even increment it automatically.)
I'm a perpetual Unity newbie, so if you have any suggestions on how to tweak this further, let me know in the comments!
– @hmans, July 2020