Skip to content

Commit 4fc80db

Browse files
committed
set variable test
set variable test 1 set variable test 2
1 parent 197df29 commit 4fc80db

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

.github/workflows/gradle-build.yml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,8 @@ jobs:
5656
steps:
5757
- uses: actions/checkout@v2
5858
- name: Get Version
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
59+
run: .\scripts\getLatestVersion.ps1
7160
shell: pwsh
7261
- name: Test Print
7362
run: echo "${{ env.RELEASE_TAG }}"
63+

scripts/getLatestVersion.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ $minorVersion = $findVersions[1].Substring($versionIndex+2)
2929
$patchVersion = $findVersions[2].Substring($versionIndex+2)
3030
$version = "$majorVersion.$minorVersion.$patchVersion"
3131

32-
echo "RELEASE_TAG=$version" >> $GITHUB_ENV
32+
#Set Enviornment variable for use to create tag
33+
echo "RELEASE_TAG=$version" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
3334
#Update the VERSION_STRING env variable and inform the user
3435
#Write-Host "##vso[task.setVariable variable=VERSION_STRING]$($version)";
3536
#Write-Host "Updated the VERSION_STRING enviornment variable with the current Gradle.Properties, $version"

0 commit comments

Comments
 (0)