зеркало из
1
0
Форкнуть 0

[Bugfix] Update version bump to bump the minor version and reset beta version (#4394)

* make it minor bump

* add stable mode

* update workflow to use new stable mode

* Change files

* update naming
This commit is contained in:
Donald McEachern 2024-04-04 13:37:44 -07:00 коммит произвёл GitHub
Родитель af0d9f3a29
Коммит a0868a3867
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
3 изменённых файлов: 17 добавлений и 2 удалений

2
.github/workflows/create-release-branch.yml поставляемый
Просмотреть файл

@ -140,7 +140,7 @@ jobs:
- name: Bump versions for pre-release branch if stable release
if: ${{ startsWith(github.event.inputs.branch, 'prerelease-stable') }}
run: |
node common/scripts/bump-beta-release-version.js beta
node common/scripts/bump-beta-release-version.js beta-next
rush update
git add .
git commit -m "Bump package versions to beta.0 for next release"

Просмотреть файл

@ -0,0 +1,9 @@
{
"type": "none",
"area": "fix",
"workstream": "CI",
"comment": "Fixes issue where version bump on stable releases was only bumping the patch version",
"packageName": "@azure/communication-react",
"email": "94866715+dmceachernmsft@users.noreply.github.com",
"dependentChangeType": "none"
}

Просмотреть файл

@ -8,7 +8,7 @@ const bumpType = process.argv[2];
const main = () => {
const packagePaths = findAllPackageJSON(PACKAGES_DIR);
const depNames = getAllNames(packagePaths);
if (!['major', 'minor', 'patch', 'beta'].includes(bumpType)) {
if (!['major', 'minor', 'patch', 'beta', 'beta-next'].includes(bumpType)) {
throw '\nplease add either major/minor/patch/beta as a parameter!\n\n Syntax:\n node bump-beta-release-version.js minor\n'
}
updateAllVersions(bumpBetaVersion);
@ -31,6 +31,12 @@ const bumpBetaVersion = (currentVersion) => {
}
const newBeta = Number.parseInt(betaVersion) + 1;
return `${major}.${minor}.${patch}-beta.${newBeta}`
} else if (bumpType === 'beta-next') {
// if bumpType is stable we want to reset the beta version
const newMinor = Number.parseInt(minor) + 1;
// patch version goes to 0 since we are bumping the next beta version's minor and we want to
// reset the patch version to 0
return `${major}.${newMinor}.${0}-beta.0`;
} else {
const newMajor = bumpType === 'major' ? Number.parseInt(major) + 1 : major;
const newMinor = bumpType === 'major' ?