Made out of wood staves with iron hoops are cannon barrels. Wasn't wood though. Iron with wood on the outside and wrapped with iron hoops, just like a beer barrel.
Military rifle barrels are made the same way any rifle barrel is made. Bar stock of a specific grade of steel and a hole is drilled through it. Hammer forging is an HK thing.