[misc] Refactored the publication workflow implementation to declare protected members & methods instead of private, so that we can extennd and overwrite it.
Added function for irrelevant data cleanup, so that this cleanup can be overwritten as well.
Cherry picked with modifications from 8957e6161cfa82ed0cdecd8b0e80bbe51e0c2728 .