The recommended way to distribute the software package is based on Computer collections rather then using users or user groups but our client has some unique requirement so below are the steps that we have followed to achieve it.
1. Enable discovery for: (by default SCCM will discover the groups every 1 day)
2. refresh the collection of user groups
3. Groups will appear in the collection.
4. right click the group to which you want to distribute the software
5. distribute—> Software
6. follow the wizard to create a new collection based on group & advertise the package to this collection.
So you have achieved publishing the package based on user groups.