Add publishing function to build file.