All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad, is His slave and Messenger.
You did wrong by swearing by the name of your friend or his life because it is impermissible to swear by other than Allah, The Exalted. The Prophet said: “Whoever has to take an oath should swear by Allah or remain silent.” [Muslim] Swearing by other than Allah, The Exalted, is a form of Shirk (polytheism). The Prophet said: “Whoever swears by other than Allah has committed disbelief or Shirk.” [Ahmad, Abu Daawood and At-Tirmithi]
However, you are not required to make expiation for breaking an oath because swearing by other than Allah does not count as a binding oath to begin with, and accordingly breaking it entails no expiation. Al-Mawsoo‘ah Al-Fiqhiyyah (The Kuwaiti Encyclopedia of Fiqh) reads: “There is no difference of opinion among Muslim jurists on the ruling that if a person swears by other than Allah, The Exalted, he is not liable for expiation should he break such an oath.” [End of Quote]
Allah knows best.