Why have the version in the source code at all? A build/packaging process should query git at build/packaging time to get the version (using git describe) and produce versioned artifacts (which can be source code or binaries).
For GitLab there there exist a workaround by using .gitattributes to create a VERSION file with "$Format:%(describe:tags)$" which will get expanded to the git describe string on archive creation, so the version number even survives in a .zip. GitHub however ignores .gitattributes and so far I haven't seen another way to get a version number into the .zip other than just including it in the source.
Gives a HEAD.zip that contains a "<repo>-<sha1>/" folder and the latest source.