Visited Cardiff and the valleys about 2 years ago and thoroughly enjoyed it.
For excellent beers i'd recommend The Cricketers on Cathedral road-it's a longish walk but you can get a bus almost to the door and the Evan Evans ale is certainly worth the trip- the food looked nice too.
Out of the handful of real ale bars within the city centre I'd recommend The Goat Major on the High street (friendly but got very busy on the weekend) with as good a pint of Brains as I've tasted.
I didn't get time to try it but the beers at the Chapter Arts centre are supposedly pretty good too.
Most memorable pub in the valleys was The Prince of Wales in Aberdare, full range of Rhymney ales on well kept taps, friendly if boisterous locals and its a proper pub, perhaps not for the faint hearted but I spent a full afternoon there
Best dining I tried was at the Thai House near Queen Street, everything was a cut above the usual Thai meals i've eaten, fresh, well prepared and delicious! Try it if you like spicy scran, but i'd ring ahead to book because I only just managed to get a table and that on a quiet wednesday evening in february.
HTH