Upgrading Windows shouldn't affect Ubuntu, unless you allow the Windows 10 installer to mess with your partitions. If the Windows 10 installer simply changes the Windows partition, it won't affect the Ubuntu partition; that's pretty straightforward.
That being said...if you care about the data that much, you need backups. Not just for this occasion, for ALL occasions. I've heard it said: There are two types of people: Those who have complete, regularly updated backups of all their important files and software...and those who will. Anyone who has experienced the sickening horror of a failed hard drive that contained the only copies of their files, will understand the black humor of this saying.
No hardware lasts forever. Buy an external drive, they're very cheap these days; $70 can get you a good 1TB USB 3.0 drive. And back up your important files. If your computer got hit by a sledgehammer right now, would you pay $70 to have all your files back? I thought so.
Back Up Your Files.