File tree Expand file tree Collapse file tree 2 files changed +18
-10
lines changed
Expand file tree Collapse file tree 2 files changed +18
-10
lines changed Original file line number Diff line number Diff line change @@ -50,14 +50,24 @@ jobs:
5050 **/gradle/**
5151 Scripts/**
5252 getTag :
53- runs-on : ubuntu -latest
53+ runs-on : windows -latest
5454 env :
5555 RELEASE_TAG : " "
56- LOCATION : .\gradle.properties
5756 steps :
5857 - uses : actions/checkout@v2
5958 - name : Get Version
60- run : .\scripts\getLatestVersion.ps1
59+ run : |
60+ $propertiesPath = ".\gradle.properties"
61+ $file = get-item $propertiesPath
62+ $findVersions = $file | Select-String -Pattern "mavenMajorVersion" -Context 0,2
63+ $findVersions = $findVersions -split "`r`n"
64+ $versionIndex = $findVersions[0].IndexOf("=")
65+ $majorVersion = $findVersions[0].Substring($versionIndex+2)
66+ $minorVersion = $findVersions[1].Substring($versionIndex+2)
67+ $patchVersion = $findVersions[2].Substring($versionIndex+2)
68+ $version = "$majorVersion.$minorVersion.$patchVersion"
69+ echo $version
70+ echo "RELEASE_TAG=HELLO" >> $GITHUB_ENV
6171 shell : pwsh
6272 - name : Test Print
63- run : echo $ RELEASE_TAG
73+ run : echo "${{ env. RELEASE_TAG }}"
Original file line number Diff line number Diff line change @@ -26,12 +26,10 @@ $findVersions = $findVersions -split "`r`n"
2626$versionIndex = $findVersions [0 ].IndexOf(" =" )
2727$majorVersion = $findVersions [0 ].Substring($versionIndex + 2 )
2828$minorVersion = $findVersions [1 ].Substring($versionIndex + 2 )
29- # $patchVersion = $findVersions[2].Substring($versionIndex+2)
30- # $version = "$majorVersion.$minorVersion.$patchVersion"
31- echo $findVersions
32- echo $majorVersion
33- echo $minorVersion
34- echo " RELEASE_TAG = $versionIndex " >> $GITHUB_ENV
29+ $patchVersion = $findVersions [2 ].Substring($versionIndex + 2 )
30+ $version = " $majorVersion .$minorVersion .$patchVersion "
31+
32+ echo " RELEASE_TAG=$version " >> $GITHUB_ENV
3533# Update the VERSION_STRING env variable and inform the user
3634# Write-Host "##vso[task.setVariable variable=VERSION_STRING]$($version)";
3735# Write-Host "Updated the VERSION_STRING enviornment variable with the current Gradle.Properties, $version"
You can’t perform that action at this time.
0 commit comments