The U.S. blocked the export of substances needed for the production of vaccines.
A question, if I donate after I have had enough am I being selfish?
If I donate food after I have eaten my fill, am I being noble or selfish?
A question in response to your question: is putting on your own air mask first when the plane cabin loses pressure, and then helping others with their masks noble or selfish?
Giving someone something you have no obligation to give them for free is literally the definition of generous. It is the opposite of selfish.
This doesn't change if you take care of yourself first.
You can't simply compare a single person with nations.
And you aren't only putting your mask on first, you are preventing others from getting theirs.
And if the west if obligated to help the poorer countries is a different discussion, especially of you consider how it takes care of them when it comes to their natural resources.
Exploiting with the left and giving with the right, doesn't make you generous.
If you could have sold it instead?
Maybe not noble but also probably kind to some degree whatever your motivations are for being kind.