Both publication and publicity originate from the word publish, but they are used differently.
Publication generally refers to a paper, journal or magazine which has been published. In legal English, publication can also refer to the process of publishing something.
Publicity is a means of sharing information publicly about a person or organization. Publicity always employs a means for sharing such information, which can be any type of media, including television, radio, print or the the Internet. It aims are create awareness of something new.
Publication is a countable noun, while publicity is always uncountable. Another difference is that publication refers to something material, while publicity is an abstract noun referring to an action or event.