Forked from ediblecode/package-json-build-number.ps1
Created
August 30, 2021 12:13
-
-
Save Joaquin6/053f88033a0d6a65491056ce83b200e3 to your computer and use it in GitHub Desktop.
Powershell script to parse a package.json version and use as the build number in TeamCity
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$version = (Get-Content package.json) -join "`n" | ConvertFrom-Json | Select -ExpandProperty "version" | |
$buildCounter = "%build.counter%" | |
$buildNumber = "$version.$buildCounter" | |
Write-Host "##teamcity[buildNumber '$buildNumber']" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment