Measurement of the cross-section and charge asymmetry of $W$ bosons produced in proton–proton collisions at $\sqrts=8 \text TeV$ with the ATLAS detector