How do I publish a package to hex correctly that has a dependency from github and is required for the package to run?
You cannot.
Only Hex packages will be included as dependencies of the package, for example Git dependencies will not be included.
Source
This is by design to make sure every package published on hex.pm can be built in the future. Github repositories can be deleted by the creator at any time but packages published on hex.pm cannot be unpublished after 1 hour of it being published.
You cannot.
Source
This is by design to make sure every package published on hex.pm can be built in the future. Github repositories can be deleted by the creator at any time but packages published on hex.pm cannot be unpublished after 1 hour of it being published.