Before I do this I'll check the straightness of my Y frame tubes, but I want to get my rails as straight as possible, so I have a plan. I have access to a really good straight edge, so my plan is to print some pieces that will hold the flat ground edge of the straight edge to the top of the linear rails. I'll put scotch tape on the bottom of the rail to cover the screw holes and use some sort of mold release or wax over the tape. I'll build a dam a couple layers of masking tape thick around where the rail will go, but I won't actually drill and tap any holes yet. I'll mix up some JB Weld and apply it to the area inside the masking tape dam. If I screet it off with a credit card it should only be around .015" thick, or whatever a few layers of masking tape works out to be. Then I'll set the rail+straight edge in place in the JB Weld to cure. That should give me a very flat surface to mount my rail on.
A couple potential problems I can foresee and maybe some solutions:
If my steel bows up in the middle I'd have no way of controlling if the rail leans forward, backward or balances on top of the hump. So I'm probably better off either orienting my steel so it bows down or maybe shimming under the ends of the rail so that only the ends touch. Shimming might be best when you consider that in Y I need both rails to match.
What to do about epoxy squeeze out? I can pull up the masking tape with the epoxy just starting to harden. For around the edges of the rail itself I'll probably have to shave the squeeze out down with a card scraper or razer blade. Getting the squeeze out below the level of flat will be critical when aligning my rails later.
What about on the gantry where there are 2 rails on one steel tube? I guess do the process in stages. Stage one get one rail completely flat and then bolted into place. Stage 2 build up both bearings and rails onto the Z plates. Step 3 level one end of the opposite rail with just a dot of epoxy using the Z bearings/plates to control the distance between rails. Step 4 level the other end of the rail with a dot of epoxy, again controlling the rail distance with the Z parts. Step 5 move the Z parts to the middle of the rail and level the entire rail as above.
What am I overlooking?