Forget about it, don't do it, that's my view.
You are doing all the labour, so you have all the downsides to brewing. You'll make next to nothing out of it. You'll get sick of it as a second job without pay, holidays, sick leave, superannuation, or long service leave.
Your "mates" are getting cheap beer, for no effort, and no risk.
As for the niceties of saying they pay only for raw ingredients, your time, gas, electricity etc, the law generally doesn't look kindly on such sophistry, and is quite willing to look behind such deals.
It's like a bloke visiting an illegal brothel and pretending to make a donation for electricity and laundry costs. Argument won't work. He's still paying for a hooker. Same with your mates, they'll be seen as paying for beer you brewed and sell without a licence.
There are also plenty of blokes who have been conned into working for someone as an "independent" contractor. Again, the law is quite ready to look behind the facade of such deals and consider the "independents" as actual employees. Same with your mates, they'll be seen as paying for beer you brewed and sell without a licence.
And lastly, your mates will be your best mates so long as you supply them with cheap booze. What happens when you want a break, get sick of doing it, are burnt out from putting down 3 brews each week for the last 6 months, or suffer with a cold or the flu etc and just can't brew? Their opinion of you is likely to change at short notice, and they're unlikely to hang around.