Run prepublish on tarball generation

Fixes #3854