Skip to content

Commit 35d0254

Browse files
committed
bump version in a single file
1 parent b87ffb1 commit 35d0254

File tree

3 files changed

+9
-21
lines changed

3 files changed

+9
-21
lines changed

azure-main.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@ trigger:
66
exclude:
77
- docs
88
- README.md
9-
# resources:
10-
# repositories:
11-
# - repository: self
12-
# type: git
13-
# ref: main
149
jobs:
1510
- job: cut_new_release_branch
1611
displayName: Agent phase
@@ -22,14 +17,10 @@ jobs:
2217
clean: true
2318
persistCredentials: True
2419
- task: PowerShell@2
25-
displayName: Bump up version
20+
displayName: Bump up version and cut a release branch
2621
inputs:
2722
filePath: .\build\bump_version.ps1
2823
arguments: .\dbops.psd1
29-
- task: PowerShell@2
30-
displayName: Cut a release branch
31-
inputs:
32-
filePath: .\build\git_release.ps1
3324
env:
3425
git_user_email: $(gitUserEmail)
3526
git_username: $(gitUsername)

build/bump_version.ps1

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
Param (
22
$Path = '.\dbops.psd1'
33
)
4+
git config --global user.email $env:git_user_email
5+
git config --global user.name $env:git_username
46
$moduleFile = Invoke-Command -ScriptBlock ([scriptblock]::Create((Get-Content $Path -Raw)))
57
$version = [Version]$moduleFile.ModuleVersion
68
$regEx = "^([\s]*ModuleVersion[\s]*\=[\s]*)\'(" + [regex]::Escape($version) + ")\'[\s]*`$"
@@ -15,4 +17,9 @@ if ($version -le $publishedVersion) {
1517
$content | Foreach-Object { $_ -replace $regEx, "`$1'$newVersion'" } | Out-File $Path -Force -Encoding utf8
1618
$newModuleFile = Invoke-Command -ScriptBlock ([scriptblock]::Create((Get-Content $Path -Raw)))
1719
Write-Host "New build $($newModuleFile.ModuleVersion)"
18-
}
20+
git add $moduleFile
21+
git commit -m "v$version"
22+
}
23+
git push origin HEAD:development
24+
git branch release/$version
25+
git push --all origin

build/git_release.ps1

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)