Skip to content

Commit 790e192

Browse files
authored
Merge pull request hmscott4#20 from randomnote1/FixBuildNumbers
Fix build numbers
2 parents d9225fd + e1953bb commit 790e192

File tree

3 files changed

+18
-13
lines changed

3 files changed

+18
-13
lines changed

AlertManagement/AlertManagement.mpproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<RootNamespace>SCOM.Alert.Management</RootNamespace>
66
<Name>SCOM.Alert.Management</Name>
77
<ManagementPackName>SCOM.Alert.Management</ManagementPackName>
8-
<Version>1.0.25.103</Version>
8+
<Version>1.0.30.108</Version>
99
<MpFrameworkVersion>v7.0.2</MpFrameworkVersion>
1010
<MpFrameworkProfile>OM</MpFrameworkProfile>
1111
<ProductVersion>1.1.0.0</ProductVersion>

AlertManagement/AlertManagement.mpproj.user

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
4-
<DeploymentNextVersion>1.0.25.104</DeploymentNextVersion>
4+
<DeploymentNextVersion>1.0.30.109</DeploymentNextVersion>
55
<DeploymentAutoIncrementVersion>True</DeploymentAutoIncrementVersion>
66
<DeploymentStartAction>None</DeploymentStartAction>
77
<DeploymentWebConsoleUrl />

Build/build.ps1

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,32 +47,37 @@ foreach ( $solution in ( Get-ChildItem -Filter *.sln ) )
4747
$projectUserFile = Get-ChildItem -Path $projectFile.Directory -Filter *.mpproj.user
4848
$projectUserFileXml = [System.Xml.XmlDocument] ( $projectUserFile | Get-Content )
4949
$nextVersion = [System.Version]::new($projectUserFileXml.Project.PropertyGroup.DeploymentNextVersion)
50+
Write-Verbose -Message "Current Management Pack Version: $($nextVersion.ToString())"
5051

5152
# Break out the version components to make it easier to work with
5253
$nextVersionMajor = $nextVersion.Major
5354
$nextVersionMinor = $nextVersion.Minor
5455
$nextVersionBuild = $nextVersion.Build
5556
$nextVersionRevision = $nextVersion.Revision
5657

57-
# Increment the minor version
58-
if ( ( $env:GITHUB_REF -match '^refs/heads/dev' ) -and $env:GITHUB_HEAD_REF -and $env:GITHUB_BASE_REF )
58+
Write-Verbose -Message "Branch: $env:GITHUB_REF"
59+
switch -Regex ( $env:GITHUB_REF )
5960
{
60-
$nextVersionMinor++
61-
}
62-
63-
# Increment the major version
64-
if ( ( $env:GITHUB_REF -match '^refs/heads/main' ) -and $env:GITHUB_HEAD_REF -and $env:GITHUB_BASE_REF )
65-
{
66-
$nextVersionMajor++
67-
$nextVersionMinor = 0
61+
# Increment the minor version
62+
'^refs/heads/dev'
63+
{
64+
$nextVersionMinor++
65+
}
66+
67+
# Increment the major version
68+
'^refs/heads/main'
69+
{
70+
$nextVersionMajor++
71+
$nextVersionMinor = 0
72+
}
6873
}
6974

7075
# Increment the build
7176
$nextVersionBuild++
7277

7378
# Create the new version
7479
$newVersion = [System.Version]::new($nextVersionMajor,$nextVersionMinor,$nextVersionBuild,$nextVersionRevision)
75-
Write-Verbose -Message "Management Pack Version: $($newVersion.ToString())"
80+
Write-Verbose -Message "New Management Pack Version: $($newVersion.ToString())"
7681

7782
# Set the next management pack version in the project file
7883
$projectFileXml = [System.Xml.XmlDocument] ( $projectFile | Get-Content )

0 commit comments

Comments
 (0)