A GPG sig proves that the file was signed & uploaded by the author, which defacto doubles as proof that it's the same file. The idea here is that the author uploads their public key, signs the package with their private key, and now there's an association between the package and the author. An attacker would have to obtain the author's private key, or replace the public key with their own. Changing the public key, however, is a big red flag.
I couldn’t care less if the Chinese government hosts an install script, if there’s no possibility they could have changed a single byte of the script.
Assuming I have a trusted way of knowing the installer script hash (which is a big assumption), I don’t need authentication for the script download, I only need integrity checks.
With GPG the developer has a key pair (one private, one public). They can then sign all their scripts with their private key and publish the public one wherever. You can then take that public key and verify that the script has been indeed signed by the developers private key.
This is the overview:
Developer generates a private/public key they use for all of their projects.
You import their public key once - you can verify this from their github, twitter, etc but that's optional.
They can sign a file with their key. You can check this signature against their public key. This will guarantee the file was signed by using that key and is unmodified.
If someone hijacks the website after this point and signs the new downloads with their own key - then you will be able to see it's invalid.
If you manually verify the key then you'll know your initial download is valid - if you trust on first use then you at least know all future files signed from that developer with that cert are valid.
They also are effectively a hash for file integrity.
tl;dr - hashes tell you if a file is changed. Signatures tell you if the file is changed, and who the person that made the file is.