Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ steps:
pwsh: true
targetType: inline
script: |
. "$(System.DefaultWorkingDirectory)\tools\Versions\BumpModuleVersion.ps1" -BumpV1Module -BumpBetaModule -BumpAuthModule -Debug
. "$(System.DefaultWorkingDirectory)\tools\Versions\BumpModuleVersion.ps1" -BumpV1Module -BumpBetaModule -BumpAuthModule -PreReleaseTag "rc" -Debug

- task: Bash@3
displayName: Commit downloaded files
Expand Down
6 changes: 3 additions & 3 deletions config/ModuleMetadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
],
"versions": {
"authentication": {
"prerelease": "preview10",
"prerelease": "rc1",
"version": "2.0.0"
},
"beta": {
"prerelease": "preview10",
"prerelease": "rc1",
"version": "2.0.0"
},
"v1.0": {
"prerelease": "preview10",
"prerelease": "rc1",
"version": "2.0.0"
}
}
Expand Down
5 changes: 5 additions & 0 deletions src/readme.graph.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,11 @@ directive:
subject: ^Link(.*)HasPayload$
set:
subject: Has$1PayloadLink
- where:
verb: Get
subject: ^(.*)List(.*)(As.*)$
set:
subject: $1$2$3
# Remove *AvailableExtensionProperty commands except those bound to DirectoryObject.
- where:
subject: ^(?!DirectoryObject).*AvailableExtensionProperty$
Expand Down
1 change: 1 addition & 0 deletions tools/BuildModule.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ if ($Prerelease) {
$FullVersionNumber = "$Version-$Prerelease"
}
else {
$ModuleManifestSettings.Prerelease = " "
$FullVersionNumber = $Version
}

Expand Down
7 changes: 4 additions & 3 deletions tools/Versions/BumpModuleVersion.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Param(
[switch] $BumpV1Module,
[switch] $BumpBetaModule,
[switch] $BumpAuthModule,
[string] $PreReleaseTag,
[string] $Repository = "PSGallery"
)
$ErrorActionPreference = "Stop"
Expand All @@ -15,23 +16,23 @@ $ErrorActionPreference = "Stop"
# Calculate and bump v1.0 module version
if ($BumpV1Module.IsPresent) {
$v1Module = Find-Module "Microsoft.Graph" -Repository $Repository -AllowPrerelease
$newV1Version = Invoke-BumpMinorOrPreReleaseVersion -FullVersion $v1Module.Version
$newV1Version = Invoke-BumpMinorOrPreReleaseVersion -FullVersion $v1Module.Version -PreReleaseTag $PreReleaseTag
Write-Debug "Bumping Microsoft.Graph to $newV1Version"
Set-ModuleVersion -SetV1Module -Version $newV1Version[0] -Prerelease $newV1Version[1]
}

# Calculate and bump beta module version
if ($BumpBetaModule.IsPresent) {
$betaModule = Find-Module "Microsoft.Graph.Beta" -Repository $Repository -AllowPrerelease
$newBetaVersion = Invoke-BumpMinorOrPreReleaseVersion -FullVersion $betaModule.Version
$newBetaVersion = Invoke-BumpMinorOrPreReleaseVersion -FullVersion $betaModule.Version -PreReleaseTag $PreReleaseTag
Write-Debug "Bumping Microsoft.Graph.Beta to $newBetaVersion"
Set-ModuleVersion -SetBetaModule -Version $newBetaVersion[0] -Prerelease $newBetaVersion[1]
}

# Calculate and bump auth module version
if ($BumpAuthModule.IsPresent) {
$authModule = Find-Module "Microsoft.Graph.Authentication" -Repository $Repository -AllowPrerelease
$newAuthVersion = Invoke-BumpMinorOrPreReleaseVersion -FullVersion $authModule.Version
$newAuthVersion = Invoke-BumpMinorOrPreReleaseVersion -FullVersion $authModule.Version -PreReleaseTag $PreReleaseTag
Write-Debug "Bumping Microsoft.Graph.Authentication to $newAuthVersion"
Set-ModuleVersion -SetAuthModule -Version $newAuthVersion[0] -Prerelease $newAuthVersion[1]
}
17 changes: 12 additions & 5 deletions tools/Versions/SetModuleVersion.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,20 @@ function Set-ModuleVersion {

function Invoke-BumpMinorOrPreReleaseVersion {
Param(
[string] $FullVersion
[string] $FullVersion,
[string] $PreReleaseTag
)
$versionSegments = $FullVersion -split "-preview"
if ($versionSegments.Count -gt 1) {
$version = [System.Version]("$($versionSegments[0]).$($versionSegments[1])")
$versionSegments = $FullVersion -split "-"
if ($versionSegments.Count -gt 1 -and [string]::IsNullOrWhiteSpace($PreReleaseTag) -eq $false) {
$PreReleaseVersion = $versionSegments[1] -split $PreReleaseTag
if ($PreReleaseVersion.Count -gt 1) {
$version = [System.Version]("$($versionSegments[0]).$($PreReleaseVersion[1])")
}
else {
$version = [System.Version]("$($versionSegments[0]).0")
}
$newVersion = "$($version.Major).$($version.Minor).$($version.Build)"
$newPrereleaseVersion = "preview$($version.Revision + 1)"
$newPrereleaseVersion = "$PreReleaseTag$($version.Revision + 1)"
}
else {
$version = [System.Version]("$($versionSegments[0])")
Expand Down