build: write abi version to published npm package (#47598)
This commit is contained in:
parent
4f69c5835e
commit
d347632046
1 changed files with 14 additions and 0 deletions
|
@ -136,6 +136,20 @@ new Promise<string>((resolve, reject) => {
|
||||||
|
|
||||||
return release;
|
return release;
|
||||||
})
|
})
|
||||||
|
.then(async (release) => {
|
||||||
|
const gnArgs = await fs.promises.readFile(path.resolve(ELECTRON_DIR, 'build/args/all.gn'), 'utf8');
|
||||||
|
|
||||||
|
const abiVersionLine = gnArgs.split('\n').find((line) => line.startsWith('node_module_version = '));
|
||||||
|
const abiVersion = abiVersionLine ? abiVersionLine.split('=')[1].trim() : null;
|
||||||
|
if (!abiVersion) {
|
||||||
|
throw new Error('Could not find node_module_version in GN args');
|
||||||
|
}
|
||||||
|
|
||||||
|
const abiVersionFile = path.join(tempDir, 'abi_version');
|
||||||
|
await fs.promises.writeFile(abiVersionFile, abiVersion);
|
||||||
|
|
||||||
|
return release;
|
||||||
|
})
|
||||||
.then(async (release) => {
|
.then(async (release) => {
|
||||||
const currentBranch = await getCurrentBranch();
|
const currentBranch = await getCurrentBranch();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue