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

[Pipelines] Add compute-version-variables.ps1 to update the YAML file #1782

Merged
merged 3 commits into from
Apr 2, 2024

Conversation

dvoituron
Copy link
Collaborator

[Pipelines] Add compute-version-variables.ps1 to update the YAML file

Adding a script compute-version-variables.ps1 to compute AssemblyVersion and PackageVersion.

Examples.

For a PR

➡️ .\compute-version-variables -branchName "users\dvoituron\stuff" -buildNumber "4.6.1.24123.3"

Compute AssemblyVersion and PackageVersion.

##vso[task.setvariable variable=AssemblyVersion]4.6.1.24123
##vso[task.setvariable variable=PackageVersion]4.6.1-preview.24123.3
##vso[task.setvariable variable=ShouldTest]false

-----------------------------------------------
 -  Branch                 = PR
 -  BuildNumber            = 4.6.1.24123.3
 -  PackageSuffix          =
-----------------------------------------------
 -> AssemblyVersion        = 4.6.1.24123
 -> PackageVersion         = 4.6.1-preview.24123.3
 -> ShouldTest             = false
-----------------------------------------------

For dev branch

➡️.\compute-version-variables -branchName "dev" -buildNumber "4.6.1.24123.3"

Compute AssemblyVersion and PackageVersion.

##vso[task.setvariable variable=AssemblyVersion]4.6.1.24123
##vso[task.setvariable variable=PackageVersion]4.6.1-preview.24123.3
##vso[task.setvariable variable=ShouldTest]false

-----------------------------------------------
 -  Branch                 = dev
 -  BuildNumber            = 4.6.1.24123.3
 -  PackageSuffix          =
-----------------------------------------------
 -> AssemblyVersion        = 4.6.1.24123
 -> PackageVersion         = 4.6.1-preview.24123.3
 -> ShouldTest             = false
-----------------------------------------------

For main branch

➡️.\compute-version-variables -branchName "main" -buildNumber "4.6.1.24123.3"

Compute AssemblyVersion and PackageVersion.

##vso[task.setvariable variable=AssemblyVersion]4.6.1.24123
##vso[task.setvariable variable=PackageVersion]4.6.1
##vso[task.setvariable variable=ShouldTest]false

-----------------------------------------------
 -  Branch                 = main
 -  BuildNumber            = 4.6.1.24123.3
 -  PackageSuffix          =
-----------------------------------------------
 -> AssemblyVersion        = 4.6.1.24123
 -> PackageVersion         = 4.6.1
 -> ShouldTest             = false
-----------------------------------------------

With Tests

➡️.\compute-version-variables -branchName "dev" -buildNumber "4.6.1.24123.3" -testProjects "..."

Compute AssemblyVersion and PackageVersion.

##vso[task.setvariable variable=AssemblyVersion]4.6.1.24123
##vso[task.setvariable variable=PackageVersion]4.6.1-preview.24123.3
##vso[task.setvariable variable=ShouldTest]true

-----------------------------------------------
 -  Branch                 = dev
 -  BuildNumber            = 4.6.1.24123.3
 -  PackageSuffix          =
-----------------------------------------------
 -> AssemblyVersion        = 4.6.1.24123
 -> PackageVersion         = 4.6.1-preview.24123.3
 -> ShouldTest             = true
-----------------------------------------------

Summary

image

@dvoituron dvoituron requested a review from vnbaaij April 2, 2024 12:18
@vnbaaij vnbaaij enabled auto-merge (squash) April 2, 2024 12:26
@vnbaaij vnbaaij merged commit e8f1f92 into dev Apr 2, 2024
7 checks passed
@vnbaaij vnbaaij deleted the users/dvoituron/compute-version-variables.ps1 branch April 2, 2024 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants