You publish events in the processAction() method of the portlet code by calling setEvent() on the ActionResponse object. This setEvent() method takes two parameters: the QName of the event object and the type of object defined in portlet.xml.
Following is an example of processAction() method.