-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Support calculating and setting release date #14876
Merged
pakrym
merged 5 commits into
Azure:master
from
pakrym:pakrym/support-setting-release-data
Sep 4, 2020
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,9 @@ Update-PkgVersion.ps1 -ServiceDirectory core -PackageName Azure.Core | |
Updating package version for Azure.Core with a specified verion | ||
Update-PkgVersion.ps1 -ServiceDirectory core -PackageName Azure.Core -NewVersionString 2.0.5 | ||
|
||
Updating package version for Azure.Core with a specified verion and release date | ||
Update-PkgVersion.ps1 -ServiceDirectory core -PackageName Azure.Core -NewVersionString 2.0.5 -ReleaseDate "2020-05-01" | ||
|
||
Updating package version for Microsoft.Azure.CognitiveServices.AnomalyDetector | ||
Update-PkgVersion.ps1 -ServiceDirectory cognitiveservices -PackageName Microsoft.Azure.CognitiveServices.AnomalyDetector -PackageDirName AnomalyDetector | ||
|
||
|
@@ -42,7 +45,8 @@ Param ( | |
[Parameter(Mandatory=$True)] | ||
[string] $PackageName, | ||
[string] $PackageDirName, | ||
[string] $NewVersionString | ||
[string] $NewVersionString, | ||
[string] $ReleaseDate | ||
) | ||
|
||
. ${PSScriptRoot}\..\common\scripts\SemVer.ps1 | ||
|
@@ -68,7 +72,7 @@ if ([System.String]::IsNullOrEmpty($NewVersionString)) { | |
else { | ||
$packageSemVer = [AzureEngSemanticVersion]::new($NewVersionString) | ||
|
||
& "${PSScriptRoot}/../common/Update-Change-Log.ps1" -Version $packageSemVer.ToString() -ChangeLogPath $changeLogPath -Unreleased $false -ReplaceVersion $true | ||
& "${PSScriptRoot}/../common/Update-Change-Log.ps1" -Version $packageSemVer.ToString() -ChangeLogPath $changeLogPath -Unreleased $false -ReplaceVersion $true -ReleaseDate $ReleaseDate | ||
} | ||
|
||
Write-Host "New Version: ${packageSemVer}" | ||
|
@@ -77,7 +81,7 @@ if ($packageSemVer.HasValidPrereleaseLabel() -ne $true){ | |
exit 1 | ||
} | ||
|
||
if (!$packageOldSemVer.IsPrerelease) { | ||
if (!$packageOldSemVer.IsPrerelease -and ($packageVersion -ne $NewVersionString)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't set ApiCompatVersion if it's the same. |
||
if (!$propertyGroup.ApiCompatVersion) { | ||
$propertyGroup.InsertAfter($csproj.CreateElement("ApiCompatVersion"), $propertyGroup["Version"]) | Out-Null | ||
$whitespace = $propertyGroup["Version"].PreviousSibling | ||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you declaring booleans as strings? PowerShell way is
[switch] $Unreleased
. Specifying it means$true
, but you can pass:$false
or:$true
explicitly like-Unreleased:$false
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't know :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll leave it as is for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes lets not change too much here currently. @chidozieononiwu does have issue Azure/azure-sdk-tools#829 which we will use as a clean-up effort for our various PS scripts.