I have read all but the Rig Veda. I never got around to reading Rig Veda because I was focused on other literature and other myths at the time.
The story of Gilgamesh was based on older oral tradition of the Sumerian, and then transmitted into Sumerian writings on clay tablets, into 5 different poems. These tablets were dated to the late 3rd millennium BCE, to the 3rd dynasty of Ur (c 2112 - c 2004 BCE). These were not written in a single epic, but as distinct stories:
- Bilgames and Agga. Agga was a king of Kish.
- Bilgames and Huwawa, which appeared in the episode within the Epic of Gilgamesh. Huwawa became Humbala in Babylonian and Assyrian versions.
- Bilgames and the Bull of Heaven, is another adventure that reappeared in the Epic.
- Bilgames, Enkidu and the Netherworld, in which Enkidu was trapped in the Netherworld.
- The Death of Bilgames, in which the mention of the hero having met Ziusudra, the hero of the Flood. There are no detail about the Flood story; what it does say is that Bilgames met Ziusudra and brought back the custom of hand washing that was lost during the Flood.
Bilgames is the Sumerian name for Gilgamesh.
There were other stories, especially hymns to the gods and hymns to kings, some written in this dynasty in this city of Ur, but others were written in other cities (eg Eridu, Nippur) in Sumer, some that were contemporary to the 3rd dynasty and others were older. And we don’t know of the names of any authors.
We also don’t know who wrote these tablets, but they (especially the myth of Gilgamesh) were so popular, they continued to exist in the Akkadian dialect, in Old Babylonian (period from19th to 16th centuries BCE), and was written in epic form, hence the Epic of Gilgamesh, from this point onward.
The popularity of the Epic, is partly due to being copied by apprentices in scribe schools, and the Epic of Gilgamesh, were one of many stories copied by students, and the Epic continued in the Middle Babylonian period (c 1600 - c 1155 BCE) and the Neo-Babylonian and Neo-Assyrian period.
It is during the early Middle Babylonian period, that we find fragments of the Epic of Gilgamesh in royal archives of Hattusa (a Hittite capital), in Ugarit, in Megiddo and in Amarna (Egypt).
It is also in this period (ie Middle Babylonian) we know of at least one scribe, Sîn-lēqi-unninni, who lived some where between 1300 and 1100 BCE. It is rare to find names of scribes or authors in Sumerian and Akkadian writings, especially in the 2nd millennium BCE.
The most famous tablets of this epic was that found in the Library at Nineveh, which was built during the reign of Ashurbanipal (reign 668 - c 627 BCE, hence in the late Neo-Assyrian period), which 12 tablets were found.
As to the Pyramid Texts (late Old Kingdom period), these are found in chamber walls of the pyramids of Unas (last king of the 5th dynasty) and the 6th dynasty Teti, Pepi I, and Pepi II (pyramids of his 3 queens). These texts were only found in the necropolis of Saqqara; no such texts were found in earlier dynasties (3rd and 4th dynasties), like the Step Pyramid Of Djoser in Saqqara (3rd dynasty) or the great pyramid of Khufu in Giza (4th dynasty).
These Pyramid Texts were most likely written by the priesthood of Ra, and were only reserved for the kings and queens (or consorts) of Egypt. So no names of authors.
During the Middle Kingdom period, the Pyramid Texts were replaced by the Coffin Texts. The afterlife focused away from the sun god Ra, and focused more on Osiris, written on coffins of kings, priests, governors and rich bureaucrats.
During the New Kingdom period, instead of finding funerary texts on tomb walls or on the coffins, they were preserved in manuscripts made of papyri, hence the Book of the Dead. Anyone who could pay copyists to write the Book of the Dead, would have had them made before they were alive.
These funerary texts were meant to assist the deceased in their afterlife, and were originally reserved for the kings of Egypt (eg the Pyramid Texts of the 5th and 6th dynasties of the Old Kingdom period) or that of later Bronze Age periods in Egypt (eg Middle Kingdom and New Kingdom periods). And they preserved some myths of the Egyptian religion and culture.
The reason why I brought up the Pyramid Texts is that they are the oldest religious texts.