Skip to content

Commit 55d3aa0

Browse files
Merge master into release
2 parents 2b60760 + 4c492e0 commit 55d3aa0

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

.github/workflows/release-staging.yml

+5
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ on:
1616
options:
1717
- master
1818
- v8
19+
verbose:
20+
description: 'Enable verbose logging'
21+
type: boolean
22+
default: false
1923

2024
jobs:
2125
deploy:
@@ -107,6 +111,7 @@ jobs:
107111
NPM_TOKEN_APP_CHECK_COMPAT: ${{ secrets.NPM_TOKEN_APP_CHECK_COMPAT }}
108112
NPM_TOKEN_API_DOCUMENTER: ${{ secrets.NPM_TOKEN_API_DOCUMENTER }}
109113
CI: true
114+
VERBOSE_NPM_LOGGING: ${{github.event.inputs.verbose}}
110115
- name: Get release version
111116
id: get-version
112117
# STAGING_VERSION = version with staging hash, e.g. 1.2.3-20430523

scripts/release/utils/publish.ts

+15-3
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ async function publishPackageInCI(
108108
npmTag: string,
109109
dryRun: boolean
110110
) {
111+
let stdoutText = '';
112+
let stderrText = '';
111113
try {
112114
const path = await mapPkgNameToPkgPath(pkg);
113115

@@ -128,24 +130,34 @@ async function publishPackageInCI(
128130
args.push('--dry-run');
129131
}
130132

133+
if (process.env.VERBOSE_NPM_LOGGING === 'true') {
134+
args.push('--verbose');
135+
}
136+
131137
// Write proxy registry token for this package to .npmrc.
132138
await exec(
133139
`echo "//wombat-dressing-room.appspot.com/:_authToken=${
134140
process.env[getEnvTokenKey(pkg)]
135141
}" >> ~/.npmrc`
136142
);
137-
138143
const spawnPromise = spawn('npm', args, { cwd: path });
139144
const childProcess = spawnPromise.childProcess;
145+
// These logs can be very verbose. Only print them if there's
146+
// an error.
140147
childProcess.stdout?.on('data', function (data) {
141-
console.log(`[publishing ${pkg}] stdout: `, data.toString());
148+
stdoutText += data.toString();
142149
});
143150
childProcess.stderr?.on('data', function (data) {
144-
console.log(`[publishing ${pkg}] stderr: `, data.toString());
151+
stderrText += data.toString();
145152
});
146153
await spawnPromise;
147154
return spawnPromise;
148155
} catch (err) {
156+
console.log(`Error publishing ${pkg}`);
157+
console.log(`stdout for ${pkg} publish:`);
158+
console.log(stdoutText);
159+
console.log(`stderr for ${pkg} publish:`);
160+
console.error(stderrText);
149161
throw err;
150162
}
151163
}

0 commit comments

Comments
 (0)