[build] Update artifact checksums to sha512, properly format file (#129485)

* [build] Update artifact checksums to sha512, properly format file

This updates the checksum algorithm from sha1 to sha512 to be consistent
with the checksums shared on our downloads page.  It also formats the
file to include the file name after the checksum so we can perform
validation via the `shasum` cli.

* basename

* formatting
This commit is contained in:
Jonathan Budzenski 2022-04-05 11:28:55 -05:00 committed by GitHub
parent fc33bb614c
commit 730245e6de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,6 +6,7 @@
* Side Public License, v 1.
*/
import path from 'path';
import globby from 'globby';
import { getFileHash, write, GlobalTask } from '../lib';
@ -21,7 +22,10 @@ export const WriteShaSums: GlobalTask = {
});
for (const artifact of artifacts) {
await write(`${artifact}.sha1.txt`, await getFileHash(artifact, 'sha1'));
await write(
`${artifact}.sha512.txt`,
`${await getFileHash(artifact, 'sha512')} ${path.basename(artifact)}`
);
}
},
};