Skip to content

Commit 197df29

Browse files
committed
attempt to fix versionScript
attempt to fix versionScript 8 attempt to fix versionScript 9 attempt to fix versionScript 10 attempt to fix versionScript 11 attempt to fix versionScript 12 attempt to fix versionScript 13 attempt to fix versionScript 14 attempt to fix versionScript 16
1 parent 3532eeb commit 197df29

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

.github/workflows/gradle-build.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff 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 }}"

scripts/getLatestVersion.ps1

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff 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"

0 commit comments

Comments
 (0)