In the scriptures, "Do good, avoid harm, purify the mind. This is the teachings of all Buddhas."
Notice the order. Sometimes, you're going to see the order slightly different: "Avoid harm, do good, purify the mind. This is the teachings of all Buddhas."
Either of these orders doesn't matter, because: what is he saying to do first? "Do good, and avoid harm." Second, "Purify the mind". Ah! So he's not expecting you to do all your good stuff with a purified mind. He's expecting that you have a defiled mind. You are attached to the 8 worldly dhammas, you're going to want fame sometimes, you're going to want praise, and so on. But he's still saying "Do good, do good. Avoid harm, avoid harm." In the next stage we'll work more on the mind.
In this way, any opportunity you have to do good, do it. If you're aware that you're getting caught up in praise afterward, okay, each one of you has methods to deal with that. Note it, note it; realize it, see the Dukkha of it, and see if you can let go of it more and more. To avoid doing good, just because you know you're going to get puffed up about it? No! We still want to do good. Work with the "puffed up" afterward, because the good is still good.
Also, in relationship to this, the Buddha lists different ways of giving. I don't have it memorized but there's "stingy giving," "ordinary giving," and I think there's "selfless giving," and "kingly giving." He goes through these different ways to point out that sometimes we're giving, but we don't really want to give, but we think we "should." Sometimes we're giving, but it was just something we were going to throw away anyhow, so, "What the heck." Sometimes we're giving, because we really feel we'd like to give. Sometimes we're giving because the person needs it. We don't really care about them, but, 'Oh, well, they need it...". So there are these different types of giving, yet giving will always bring beneficial results.
The giving itself is a good Karmic action. The mental state with it might not be so pure, but that's okay, we'll work on that as a second practice, but don't hold back from giving and doing good Kamma just because you see your intention isn't perfect.