According to the below paper, the coronavirus spike protein sequence was available to scientists by end of february 2020 - the begin of march 2020 timeline. I had this question that why does sequencing of a virus protein take so much time (I am a software engineer, currently studying molecular biology to better understand the pandemic, hence I am seriously unaware!) ? The reason of asking is because, in case of another epidemic, we might need to spend again a lot of time to sequence the protein. This might be a real concern!
Sequencing a viral genome requires isolation of the virus, propagation in cell culture, extraction of nucleic acids, and preparation of a sequencing library. Once sequences are obtained, a genome can be assembled de novo using (untargeted) shotgun reads, and gaps in the genome can be spanned with (targeted) Sanger sequencing. This process can take weeks to months depending on the availability of resources and the growth characteristics of the virus.
For details on how the 2019-nCoV genome was sequenced, see Zhu et al., published January 2020:
Sequencing DNA (which is what was done for the COVID virus, post reverse transcription as it is an RNA virus) does not take very long. A NextSeq instrument can provide results in <24 hours. Protein sequences are inferred from the DNA sequence using gene/ORF calling software.
SOme of this is suggested by @acvill, though I think that they are pessimistic about time estimates. Viral genomes are pretty easy to assemble (matter of hours). In principle you can dispense with the isolation step too, though that makes the analysis more complex.
It is all the medical and bioinformatic stuff around the sequencing, e.g. isolation and analysis and ethical paperwork (necessary!), which takes time.