Contributing to open source for free is easier than landing clients. But your time is better spent looking for clients or just putting some code you have already written on Github. Just putting some code on Github lets recruiters check a box if that's all they are doing.
If a recruiter is looking for evidence of specific technical competence on Github (Java, machine learning, Angular, etc.), no matter what projects you work on, your work probably won't reflect the specific skill. There are just too many possible skills.
Anyway, working for free is about the worst approach to a career as a contractor/consultant/freelancer. Selling is hard and necessary.