I don't know if I would ever be so involved as to build up a bike, but having spent most of my life in and around machine shops, I would probably use LPS spray in the tubes (after painting). It is formulated to leave a coating that prevents rust. We used it, and found it, on all bare steel surfaces that were exposed, such as tube stock and plate stock, whether machined or in the raw. It's a little sticky, but it needs to stay put.
When we recieved new machined parts or precision tooling, it would be thus coated from the vendor. No rust. Also, new firearms are coated lightly with something similar, I'm sure. I don't think it's cosmoline anymore although some arsenal surplus is still coated with it.
LPS also comes in a WD-40 formula - that's not the stuff I'm talking about.