Prophet Adam (Peace be upon him) was the first who erected the Ka'bah. This is mentioned in a narration from Imam aal-Sadiq (AS) ( Wasaa'il Al-Shia , volume 13, page 208, Hadeeth number 17578).
circling around Ka'bah seven rounds is the way of worshiping Allah practiced by all the Prophets and infallible Imams (AS). It is like performing Rukoo' and Sujood in Salah.
'Wassalam.