Skip to content

Commit 3e2ccad

Browse files
committed
Print additional debug information
1 parent e81bf7a commit 3e2ccad

File tree

3 files changed

+46
-15
lines changed

3 files changed

+46
-15
lines changed

.github/workflows/build.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ jobs:
2525
- name: Package
2626
run: |
2727
node release-automation/build.js --debian --tarball --appimage --x64 --armv7l --arm64
28+
env:
29+
DEBUG: electron-builder
30+
- name: Debug info
31+
run: node scripts/print-file-tree.js dist
2832
- name: Upload artifacts to GitHub Actions
2933
uses: actions/upload-artifact@v4
3034
with:
@@ -56,6 +60,10 @@ jobs:
5660
run: |
5761
node release-automation/build.js --mac --universal
5862
node release-automation/build.js --mac-legacy-10.13-10.14 --mac-legacy-10.15 --x64
63+
env:
64+
DEBUG: electron-builder
65+
- name: Debug info
66+
run: node scripts/print-file-tree.js dist
5967
- name: Upload artifacts to GitHub Actions
6068
uses: actions/upload-artifact@v4
6169
with:
@@ -109,6 +117,11 @@ jobs:
109117
node release-automation/build.js --windows --microsoft-store --x64 --ia32 --arm64
110118
node release-automation/build.js --windows-portable --x64
111119
node release-automation/build.js --windows-legacy --ia32 --x64
120+
env:
121+
DEBUG: electron-builder
122+
- name: Debug info
123+
working-directory: D:\repo
124+
run: node scripts/print-file-tree.js dist
112125
- name: Upload artifacts to GitHub Actions
113126
uses: actions/upload-artifact@v4
114127
with:

release-automation/build.js

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ require('./patch-electron-builder');
22

33
const fs = require('fs');
44
const pathUtil = require('path');
5-
const nodeCrypto = require('crypto');
65
const builder = require('electron-builder');
76
const electronFuses = require('@electron/fuses');
87

@@ -49,18 +48,7 @@ const getArchesToBuild = (platformName) => {
4948
return arches;
5049
};
5150

52-
const afterAllArtifactBuild = (buildResult) => {
53-
for (const artifactPath of buildResult.artifactPaths) {
54-
const data = fs.readFileSync(artifactPath);
55-
const hash = nodeCrypto
56-
.createHash('sha-256')
57-
.update(data)
58-
.digest('hex');
59-
console.log(`${hash} ${artifactPath}`);
60-
}
61-
};
62-
63-
const addElectronFuses = async (context) => {
51+
const flipFuses = async (context) => {
6452
const electronMajorVersion = +context.packager.info.framework.version.split('.')[0];
6553

6654
/** @type {import('@electron/fuses').FuseV1Config} */
@@ -96,7 +84,7 @@ const addElectronFuses = async (context) => {
9684
};
9785

9886
const afterPack = async (context) => {
99-
await addElectronFuses(context)
87+
await flipFuses(context);
10088
};
10189

10290
const build = async ({
@@ -135,7 +123,6 @@ const build = async ({
135123
tw_warn_legacy: isProduction,
136124
tw_update: isProduction && manageUpdates
137125
},
138-
afterAllArtifactBuild,
139126
afterPack,
140127
...extraConfig,
141128
...await prepare(archName)

scripts/print-file-tree.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
const pathUtil = require('path');
2+
const fs = require('fs');
3+
const nodeCrypto = require('crypto');
4+
5+
const recursivelyPrint = (directory) => {
6+
const dirStat = fs.statSync(directory);
7+
console.log(pathUtil.join(directory, '/'));
8+
console.log(`\tModified: ${dirStat.mtime.toUTCString()}`);
9+
10+
const children = fs.readdirSync(directory);
11+
for (const child of children) {
12+
const path = pathUtil.join(directory, child);
13+
const childStat = fs.statSync(path);
14+
if (childStat.isFile()) {
15+
console.log(path);
16+
const data = fs.readFileSync(path);
17+
const sha256 = nodeCrypto
18+
.createHash('sha256')
19+
.update(data)
20+
.digest('hex');
21+
console.log(`\tSHA-256: ${sha256}`);
22+
console.log(`\tModified: ${childStat.mtime.toUTCString()}`);
23+
} else {
24+
recursivelyPrint(path);
25+
}
26+
}
27+
};
28+
29+
for (let i = 2; i < process.argv.length; i++) {
30+
recursivelyPrint(process.argv[i]);
31+
}

0 commit comments

Comments
 (0)