build: depshash logging

This commit is contained in:
Samuel Attard
2024-09-27 09:25:44 -07:00
parent f7ac1bf039
commit 6db7a0f0af
2 changed files with 3 additions and 1 deletions

View File

@@ -38,7 +38,7 @@ runs:
- name: Generate DEPS Hash
shell: bash
run: |
node src/electron/script/generate-deps-hash.js && cat src/electron/.depshash-target
node src/electron/script/generate-deps-hash.js && cat src/electron/.depshash && cat src/electron/.depshash-target
echo "DEPSHASH=v1-src-cache-$(sha1sum src/electron/.depshash | cut -f1 -d' ')" >> $GITHUB_ENV
- name: Generate SAS Key
if: ${{ inputs.generate-sas-token == 'true' }}

View File

@@ -36,10 +36,12 @@ addAllFiles(path.resolve(__dirname, '../patches'));
// Create Hash
const hasher = crypto.createHash('SHA256');
const addToHashAndLog = (s) => {
console.log('Hashing:', s);
return hasher.update(s);
};
addToHashAndLog(`HASH_VERSION:${HASH_VERSIONS[process.platform] || FALLBACK_HASH_VERSION}`);
for (const file of filesToHash) {
console.log('file:', file, 'hash:', crypto.createHash('sha256').update(fs.readFileSync(file)).digest('hex'));
hasher.update(fs.readFileSync(file));
}