Rather than adding this to the existing `emscripten-version.txt` file.
Just in case anyone was parsing this outside of emscripten itself.
This is followup on #10789 based on feedback in that PR.
Also use `git rev-parse HEAD` to get the git revision for git users
which is slightly more efficient/reliable that trying to parse
`git show` output.
This will allow emsdk and other distributions to include an accurate
git sha.
Also, include tests/ directory in archive, but not tests/third_party/.
This should have been part of #10761.
This fixes#10660 in a more satisfactory way.
This target creates an archive that excludes parts of the source tree
that are not needed by end users.
Significantly we don't include `.git` or `tests`.
The resulting archive is 64Mb compressed and 77Mb uncompressed where as
the unfiltered contents currently in emsdk is 114Mb compressed and nd
131Mb uncompressed.
Currently the only use for the rules is to upload an artifact to github
CI. However as a followup we can start using this rule when building
the emsdk archives to save significant amount data for our users.