BartoszMilewski, There is very little incentive to publish books through a publishing company. The financial incentive is truly negligible. It's nice to have professional editors, but if the book is freely available on GitHub, readers will correct your errors anyway. I don't think the promotion by a publisher does more than what you can achieve through social media. If you know how to use LaTeX, and you don't want your book to be protected by a paywall, my advice is to just make it public domain.