Skip to content

Commit

Permalink
include patch when versioning tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
arturcic committed Feb 10, 2020
1 parent cf8a2d8 commit 4dc8ca3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ jobs:
$version = "${{steps.gitversion.outputs.majorMinorPatch}}.$date"
$major = "${{steps.gitversion.outputs.major}}"
$minor = "${{steps.gitversion.outputs.minor}}"
$patch = "${{steps.gitversion.outputs.patch}}"
. .\dist\azure\update-version.ps1
update-manifest .\dist\azure\vss-extension.json -Version $version
dir -r .\dist\**\task.json | % { update-task $_ -Major $major -Minor $minor }
dir -r .\dist\**\task.json | % { update-task $_ -Major $major -Minor $minor -Patch $patch }
npm run publish:azure -- --token ${{ secrets.TFX_TOKEN }}
shell: pwsh
Expand Down
11 changes: 8 additions & 3 deletions dist/azure/update-version.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,19 @@ function update-task() {

[Parameter(Mandatory=$True, Position=2, ValueFromPipeline=$false)]
[System.String]
$minor
$minor,

[Parameter(Mandatory=$True, Position=3, ValueFromPipeline=$false)]
[System.String]
$patch
)
$file = Resolve-Path $file
$jqMajor = '.version.Major=\"' + $major +'\"';
$jqMinor = '.version.Minor=\"' + $minor +'\"';
Write-Host "Update task from $file to version $major.$minor"
$jqPatch = '.version.Patch=\"' + $patch +'\"';
Write-Host "Update task from $file to version $major.$minor.$patch"

Get-Content $file | jq $jqMajor | jq $jqMinor | Set-Content $file
Get-Content $file | jq $jqMajor | jq $jqMinor| jq $jqPatch | Set-Content $file
}

function update-manifest() {
Expand Down

0 comments on commit 4dc8ca3

Please sign in to comment.