File tree Expand file tree Collapse file tree 2 files changed +7
-23
lines changed
Expand file tree Collapse file tree 2 files changed +7
-23
lines changed Original file line number Diff line number Diff line change @@ -59,11 +59,10 @@ node {
5959
6060 if (env. BRANCH_NAME == " master" ) {
6161 buildMode = " Release"
62- result = test_with_torch(" master" )
6362 } else {
6463 buildMode = " Debug"
65- result = test_with_torch(" staging" )
6664 }
65+ result = test_with_torch(" master" )
6766 if (result) {
6867 currentBuild. result = " SUCCESS"
6968 stage(' Archive' ) {
@@ -83,18 +82,6 @@ node {
8382 powershell " Add-Type -Assembly System.IO.Compression.FileSystem; [System.IO.Compression.ZipFile]::CreateFromDirectory(\"\$ PWD\\ ${ packageDir} \" , \"\$ PWD\\ ${ zipFile} \" )"
8483 archiveArtifacts artifacts : zipFile, caseSensitive : false , onlyIfSuccessful : true
8584 }
86-
87- if (env. BRANCH_NAME == " master" ) {
88- gitVersion = bat(returnStdout : true , script : " @git describe --tags" ). trim()
89- gitSimpleVersion = bat(returnStdout : true , script : " @git describe --tags --abbrev=0" ). trim()
90- if (gitVersion == gitSimpleVersion) {
91- stage(' Release' ) {
92- withCredentials([usernamePassword(credentialsId : ' torch-github' , usernameVariable : ' USERNAME' , passwordVariable : ' PASSWORD' )]) {
93- powershell " & ./Jenkins/release.ps1 \" https://api.github.com/repos/TorchAPI/Essentials/\" \" $gitSimpleVersion \" \" $USERNAME :$PASSWORD \" @(\" bin/essentials.zip\" )"
94- }
95- }
96- }
97- }
9885 }
9986 else
10087 currentBuild. result = " FAIL"
Original file line number Diff line number Diff line change 1+ $buildSalt = $Env: BUILD_NUMBER
12$gitVersion = git describe -- tags
23$gitSimpleVersion = git describe -- tags -- abbrev= 0
3- if ($gitSimpleVersion.Equals ($gitVersion )) {
4- $buildSalt = 0
5- } else {
6- $gitLatestCommit = git rev- parse -- short HEAD
7- $buildSalt = [System.Numerics.BigInteger ]::Abs([System.Numerics.BigInteger ]::Parse($gitLatestCommit , [System.Globalization.NumberStyles ]::HexNumber) % 16383 ) + 1
8- }
9- $dotNetVersion = echo $gitSimpleVersion | Select-String - Pattern " ([0-9]+)\.([0-9]+)\.([0-9]+)" | % {$_.Matches } | % {$_.Groups [1 ].Value+ " ." + $_.Groups [2 ].Value+ " ." + $_.Groups [3 ].Value+ " .$buildSalt " }
4+ $simpleVersionStandard = echo $gitSimpleVersion | Select-String - Pattern " ([0-9]+)\.([0-9]+)\.([0-9]+)" | % {$_.Matches } | % {$_.Groups [1 ].Value+ " ." + $_.Groups [2 ].Value+ " ." + $_.Groups [3 ].Value}
5+ $dotNetVersion = " $simpleVersionStandard .$buildSalt "
6+ $infoVersion = " $gitVersion " -replace " ([0-9]+)\.([0-9]+)\.([0-9]+)" , " $dotNetVersion "
107
118$fileContent = @"
129using System.Reflection;
1310
1411[assembly: AssemblyVersion("$dotNetVersion ")]
15- [assembly: AssemblyInformationalVersion("$gitVersion ")]
12+ [assembly: AssemblyInformationalVersion("$infoVersion ")]
1613"@
1714
1815echo $fileContent | Set-Content " $PSScriptRoot /AssemblyVersion.cs"
1916
20- echo " $gitVersion / $dotNetVersion "
17+ echo " $infoVersion "
You can’t perform that action at this time.
0 commit comments