Browse Source

build: move uploadIndexJson to just before publishRelease (#38700)

* build: move uploadIndexJson to just before publishRelease

Co-authored-by: David Sanders <[email protected]>

* chore: move uploadNodeShasums as well

Co-authored-by: David Sanders <[email protected]>

* build: upload node checksums before validating them

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: David Sanders <[email protected]>
Co-authored-by: Samuel Attard <[email protected]>
trop[bot] 1 year ago
parent
commit
523fa39765
1 changed files with 6 additions and 2 deletions
  1. 6 2
      script/release/release.js

+ 6 - 2
script/release/release.js

@@ -352,13 +352,17 @@ async function makeRelease (releaseToValidate) {
   } else {
     let draftRelease = await getDraftRelease();
     uploadNodeShasums();
-    uploadIndexJson();
-
     await createReleaseShasums(draftRelease);
 
     // Fetch latest version of release before verifying
     draftRelease = await getDraftRelease(pkgVersion, true);
     await validateReleaseAssets(draftRelease);
+    // index.json goes live once uploaded so do these uploads as
+    // late as possible to reduce the chances it contains a release
+    // which fails to publish. It has to be done before the final
+    // publish to ensure there aren't published releases not contained
+    // in index.json, which causes other problems in downstream projects
+    uploadIndexJson();
     await publishRelease(draftRelease);
     console.log(`${pass} SUCCESS!!! Release has been published. Please run ` +
       '"npm run publish-to-npm" to publish release to npm.');