Implement run publish function