@yrashk talking to a hired devrel expert. :D
To be honest, I think that UX sells and problem solving makes the customer return. So I'd use the common principles of marketing for devrel and would be very aggressive with pushing the #foss parts of the code I develop as far as possible.
If we're talking about the community building, it's the same principle. First make them want to contribute by having a good docs / easy ci, then make them stay by upstreaming their stuff.