A wise man once said...
The best way to get things done is to not mind who gets credit.
Not being motivated by recognition is extremely liberating. It proves that you care solely about the outcome, and nothing else.
There is something to be said about being a sacrificial team player in the workplace. It's an undervalued form of leadership.
Take the blame.
Delegate the credit.
Reap the benefits.