@@ -11,6 +11,14 @@ const getPackageVersion = () =>
1111 JSON . parse ( fs . readFileSync ( path . resolve ( __dirname , "../package.json" ) ) )
1212 . version ;
1313
14+ const binaryPlatforms = [
15+ "win-x64" ,
16+ "win-x86" ,
17+ "linux-x64" ,
18+ "linux-x86" ,
19+ "macos"
20+ ] ;
21+
1422// Get the next version, which may be specified as a semver
1523// version number or anything `npm version` recognizes. This
1624// is a "pre-release" if nextVersion is premajor, preminor,
@@ -29,9 +37,17 @@ exec("npm test");
2937// 4) Create a v* tag that points to that commit
3038exec ( `npm version ${ nextVersion } -m "Version %s"` ) ;
3139
32- // 5) Publish to npm. Use the "next" tag for pre-releases,
40+ // 5) Build a binary version for universal support
41+ exec ( `npm config set react-stdio:version ${ nextVersion } ` ) ;
42+
43+ binaryPlatforms . forEach ( platform => {
44+ exec ( `npm config set react-stdio:platform ${ platform } ` ) ;
45+ exec ( `npm run dist:binary` ) ;
46+ } ) ;
47+
48+ // 6) Publish to npm. Use the "next" tag for pre-releases,
3349// "latest" for all others
3450exec ( `npm publish --tag ${ isPrerelease ? "next" : "latest" } ` ) ;
3551
36- // 6 ) Push the v* tag to GitHub
52+ // 7 ) Push the v* tag to GitHub
3753exec ( `git push -f origin v${ getPackageVersion ( ) } ` ) ;
0 commit comments