The most important thing I do for marketing is helping people, frequently. It opens a lot of doors. It also means there are a couple of... thousand, maybe? (crikey) ... people who will say nice things about me even when I'm not in the room. That has lead directly to consulting work (and business opportunities) in the past.
Can I say one heretical thing? Contribution to OSS is not by itself marketing. It is a fairly low ROI way to reach decision makers unless you are identified with a popular project. (You can easily spend many hours on a commit that no one but you or the mainainer will ever know you wrote. Spend the same amount of time directly solving a problem for someone and you have a fan for life.)
P.S. I truly love Github, but would not host my OSS on it, because it encourages use patterns which are extraordinarily suboptimal for marketing oneself. YMMV.