You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update the script responsible for updating the package version (#3934)
## Description
Updates the `set-package-version` script to also support beta and
release candidate versions. Since those two may not be published from a
stable branch, they require explicit version to be set.
The version format for those releases would be:
```
{major}.{minor}.{patch}-rc.{rcVersion}
{major}.{minor}.{patch}-beta.{betaVersion}
```
## Test plan
Run the script in different configurations
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
thrownewError('Expected a version after --version');
108
+
}
109
+
}
110
+
}
111
+
112
+
assert([isCommitly,isBeta,isReleaseCandidate].filter(Boolean).length<=1,'Release flags --commitly, --beta, and --rc are mutually exclusive; specify at most one');
113
+
assert(version===null||isBeta||isReleaseCandidate,'Version should not be provided for stable nor commitly releases');
114
+
assert(version!==null||(!isBeta&&!isReleaseCandidate),'Version must be provided for beta and release candidate releases');
115
+
116
+
constreleaseType=isCommitly
117
+
? ReleaseType.COMMITLY
118
+
: isBeta
119
+
? ReleaseType.BETA
120
+
: isReleaseCandidate
121
+
? ReleaseType.RELEASE_CANDIDATE
122
+
: ReleaseType.STABLE;
123
+
124
+
if(version!=null){
125
+
constversionRegex=/^(\d+)\.(\d+)\.(\d+)$/;
126
+
if(!versionRegex.test(version)){
127
+
thrownewError(`Provided version "${version}" is not valid. Expected format: x.y.z`);
0 commit comments