-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxpipeline-main.yml
More file actions
40 lines (29 loc) · 1.22 KB
/
xpipeline-main.yml
File metadata and controls
40 lines (29 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: $(XConfigMaster.Major).$(XConfigMaster.Minor).$(Rev:r).0
trigger:
branches:
include:
- master
pr: none
variables:
- template: xpipeline-template-variables.yml
jobs:
- template: xpipeline-template-base.yml
parameters:
prePublishSteps:
- powershell: |
$stableVersion = (Find-Module XConfigMaster -AllowPrerelease:$false -MinimumVersion $(XConfigMaster.Major).$(XConfigMaster.Minor).0 -ErrorAction Ignore).Version
if($stableVersion){
$revision = $stableVersion -replace "(\d+.\d+.)(\d+)(.\d+)",'$2'
$revision = [Int]::Parse($revision)
$base = $stableVersion -replace "(\d+.\d+.)(\d+)(.\d+)",'$1'
$revision += 1
$newVersion = $base + $revision + ".0"
}
else{
$newVersion = "$(XConfigMaster.Major).$(XConfigMaster.Minor).0.0"
}
Update-ModuleManifest -Path "$(ModulePath)/XConfigMaster.psd1" -ModuleVersion $newVersion
Write-Output "##vso[build.updatebuildnumber]$newVersion"
workingDirectory: $(ModulePath)
name: markasprerelease
displayName: Mark as Release from PR