Updated the publish scripts to be a bit (lot) smarter.