Skip to content

Commit d2c1124

Browse files
committed
chore: update bundle release script
1 parent 7b1a97b commit d2c1124

File tree

1 file changed

+21
-9
lines changed

1 file changed

+21
-9
lines changed

scripts/bundle-release.cjs

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,33 @@ module.exports = async function({ github, workspace, publishedPackages }) {
1818
const tag = `${packageName}@${version}`;
1919
const { id } = await github.rest.repos.getReleaseByTag({ owner, repo, tag });
2020

21-
// make a tarball for the package
22-
// this was already published to npm in the changesets action
23-
const { stdout } = await execaCommand(`npm run pack -w ${name}`);
24-
const [name] = stdout.match(/^[\w-.]+\.tgz$/g);
25-
26-
const params = { name, owner, release_id: id, repo };
21+
const params = { owner, release_id: id, repo };
2722

2823
// upload the bundle to each release
29-
await github.rest.repos.uploadReleaseAsset({ ...params, data: await readFile(outfile) });
24+
await github.rest.repos.uploadReleaseAsset({
25+
...params,
26+
name: 'pfe.min.js',
27+
data: await readFile(outfile),
28+
});
29+
30+
await github.rest.repos.uploadReleaseAsset({
31+
...params,
32+
name: 'pfe.min.js.map',
33+
data: await readFile(`${outfile}.map`),
34+
});
35+
36+
// make a tarball for the package
37+
// this was already published to npm in the changesets action
38+
const { stdout } = await execaCommand(`npm run pack -w ${packageName}`);
39+
const match = stdout.match(/^[\w-.]+\.tgz$/g);
3040

3141
// upload the package tarball to the release
32-
if (name) {
42+
if (match) {
43+
const [name] = match;
3344
await github.rest.repos.uploadReleaseAsset({
3445
...params,
35-
data: await readFile(`${cwd}/${name}`)
46+
name,
47+
data: await readFile(`${cwd}/${name}`),
3648
});
3749
}
3850
}

0 commit comments

Comments
 (0)