i prefer to just buy a tube with a top rail already installed.
if you're referring to adding a rail for something like a bipod on the bottom, i'd be seriously concerned about using rivets as the attachment method. they just dont seem sturdy enough for that kind of abuse.
the standard way is to drill and tap the tube, or use a drilled/tapped backer plate inside the tube to tighten them down to the tube.
either way you want a good solid mount, something that'll take more abuse that a standard pop rivet will give you.