If you do an end-run around the normal open source publishing you can get in trouble- up to and including termination- but my guess is there is more context around the firing than just "posted open source code to work with standard Google APIs". For example, you can get punished at google (up to and including termination) for raising your voice in a meeting.