Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(version-tools): Correct handling of internal dev/prerelease versions #12734

Merged
merged 7 commits into from
Oct 31, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revert "Squashed commit of the following:"
This reverts commit c231859.
  • Loading branch information
tylerbutler committed Oct 31, 2022
commit 70293ba153b5556b1a873b5fce0e74eabe00dc59
12 changes: 7 additions & 5 deletions tools/pipelines/templates/include-set-package-version.yml
Original file line number Diff line number Diff line change
@@ -86,25 +86,27 @@ steps:
echo VERSION_PATCH=$VERSION_PATCH
echo VERSION_INCLUDE_INTERNAL_VERSIONS=$VERSION_INCLUDE_INTERNAL_VERSIONS

# Generate the build version. Sets the environment variables version, codeVersion, and isLatest.
# These are referenced in following steps prefixed by this task name. E.g. SetVersion.version
# Generate the build version
flub generate buildVersion

- task: Bash@3
displayName: Update Package Version
env:
VERSION_RELEASE: $(release)
RELEASE_GROUP: ${{ parameters.tagName }}
inputs:
targetType: 'inline'
workingDirectory: ${{ parameters.buildDirectory }}
script: |
echo SETVERSION_VERSION=$SETVERSION_VERSION
echo SETVERSION_CODEVERSION=$SETVERSION_CODEVERSION
echo RELEASE_GROUP=$RELEASE_GROUP

if [ -f "lerna.json" ]; then
flub bump $RELEASE_GROUP --exact $(SetVersion.version) -xv
if [ "$VERSION_RELEASE" = "release" ]; then
# no need to run anything here, as the version in the package should be correct
npx lerna exec "if [ \`npm -s run env echo '\$npm_package_version'\` != '$(SetVersion.version)' ]; then ( exit 1 ) fi"
exit $?
fi
npx lerna version $(SetVersion.version) --no-git-tag-version --no-push --yes --exact
else
npm version $(SetVersion.version) --no-git-tag-version -f --allow-same-version
fi