Fix bugs in release and publish scripts. #2952
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Tried the new release scripts, this PR fixes below issues:
Change from
yarn publishtoyarn publish-npm. Context: yarn publish does not work, it throws error: "Can't answer a question unless a user TTY", same issue is discussed in [lerna publish] Can't answer a question unless a user TTY lerna/lerna#1200. The reason is because yarn publish has an interactive cli, which makes it impossible to use for automation process. Tried the yarn --non-interactive publish method discussed in the thread, doesn't work either. So change to yarn publish-npm, tested locally using npm whoami as a substitute. Yarn 2.x hasyarn npm publishnatively. So once we upgrade to yarn 2.x, we don't need to have publish-npm: "npm publish" in each package.json.Combined tag version steps. Context: This script is called from the publish-npm.ts. It didn't throw any errors. But actually, only the first step that creates the tag succeed, the second step that pushes the tag didn't get executed. Combining the two steps works. It is something related to child processes.
This change is