File tree Expand file tree Collapse file tree 2 files changed +14
-9
lines changed
Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -98,16 +98,17 @@ jobs:
9898
9999 create_Tag :
100100 needs : maven_Release
101- runs-on : windows -latest
101+ runs-on : ubuntu -latest
102102 env :
103103 RELEASE_TAG : " "
104104 steps :
105105 - uses : actions/checkout@v2
106106 - name : Get Version
107+ id : GetVersion
107108 run : .\scripts\getLatestVersion.ps1
108109 shell : pwsh
109110 - name : Create tag
110111111112 with :
112- tag : " v$RELEASE_TAG "
113+ tag : ${{ steps.GetVersion.outputs.tag }}
113114
Original file line number Diff line number Diff line change @@ -21,13 +21,17 @@ if($propertiesPath -eq "" -or $null -eq $propertiesPath) {
2121}
2222$file = get-item $propertiesPath
2323$findVersions = $file | Select-String - Pattern " mavenMajorVersion" - Context 0 , 2
24- $findVersions = $findVersions -split " `r`n "
24+ $content = Get-Content $propertiesPath
2525
26- $versionIndex = $findVersions [0 ].IndexOf(" =" )
27- $majorVersion = $findVersions [0 ].Substring($versionIndex + 2 )
28- $minorVersion = $findVersions [1 ].Substring($versionIndex + 2 )
29- $patchVersion = $findVersions [2 ].Substring($versionIndex + 2 )
26+ $lineNumber = $findVersions.LineNumber - 1
27+ $versionIndex = $content [$lineNumber ].IndexOf(" =" )
28+ $versionIndex += 2 # skipping =[space]
29+ $majorVersion = $content [$lineNumber ].Substring($versionIndex )
30+ $lineNumber ++
31+ $minorVersion = $content [$lineNumber ].Substring($versionIndex )
32+ $lineNumber ++
33+ $patchVersion = $content [$lineNumber ].Substring($versionIndex )
3034$version = " $majorVersion .$minorVersion .$patchVersion "
3135
32- # Set Enviornment variable for use to create tag
33- echo " RELEASE_TAG= $ version" | Out-File - FilePath $ Env: GITHUB_ENV - Encoding utf - 8 - Append
36+ # Set Task output to create tag
37+ Write-Output " ::set-output name=tag::v ${ version} "
You can’t perform that action at this time.
0 commit comments