There is no book available now that tells you everything you need to know to write a musical, but there are several out now that can collectively give one a very good idea of how to go about it. Latest in the field is WRITING MUSICAL THEATER by Allen Cohen and Steven L. Rosenhaus. Rosenhaus and Cohen have written a very useful book that can at least get you started. As the authors themselves say, there is no better way to learn than to actually do it and to keep doing it. Other books cover some of the same material, but where this book really has something new to say is in the section dealing with the music.
The most daring section of the book (and perhaps the most useful) is the part where they actually set out to write two new shows for illustrative purposes. One is an adaptation; the other is an original. Their goal was not to create great works of art, but to show how to go about writing a musical. Neither of their examples is going to set the world on fire. In the real world they would in all likelihood be flops, but they brilliantly illustrate the practical problems that arise and some possible solutions. (Bravi, guys, and thanks.)
My only real quibbles with the book are in the bibliography where they list A CLASS ACT, CLOSER THAN EVER and STARTING HERE, STARTING NOW as important musicals. (I would love to know by what logic they arrived at those pronouncements.) They also list Johnny Mercer as an important lyricist of theatre music (none of his really good work was written for the theatre and much of his reputation is a result of self-promotion through his ownership of Capitol Records) and Dorothy Fields is not mentioned. Nor do they place Sheila Davis's brilliant THE CRAFT OF LYRIC WRITING on the recommended reading list. (I consider it The Bible of lyric writing!) They do not place Bernard Grebanier's PLAYWRITING on that list either. (There is no better analysis of what makes a plot anywhere.) But despite these quibbles, I would wholeheartedly recommend this book to the aspiring musical writer. It is an excellent place to start.