Skip to content

Commit 9d1d69a

Browse files
committed
Get version from modified script
1 parent cd7443e commit 9d1d69a

File tree

3 files changed

+34
-15
lines changed

3 files changed

+34
-15
lines changed

.github/workflows/build-and-publish.yml

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,15 @@ jobs:
3434
with:
3535
java-version: '16'
3636
distribution: 'adopt'
37-
cache: gradle
38-
- run: .\scripts\decodeAndWrite.ps1 -encodedValue $env:ENCODED_VALUE -outputPath $env:OUTPUT_PATH
37+
cache: gradle
38+
- name: Download file
39+
run: .\scripts\decodeAndWrite.ps1 -encodedValue $env:ENCODED_VALUE -outputPath $env:OUTPUT_PATH
3940
shell: pwsh
4041
env:
4142
ENCODED_VALUE: ${{ secrets.LOCAL_PROPERTIES }}
4243
OUTPUT_PATH: '.\local.properties'
43-
- run: .\scripts\decodeAndWrite.ps1 -encodedValue $env:ENCODED_VALUE -outputPath $env:OUTPUT_PATH
44+
- name: Download file
45+
run: .\scripts\decodeAndWrite.ps1 -encodedValue $env:ENCODED_VALUE -outputPath $env:OUTPUT_PATH
4446
shell: pwsh
4547
env:
4648
ENCODED_VALUE: ${{ secrets.SECRING_GPG }}
@@ -64,13 +66,15 @@ jobs:
6466
with:
6567
java-version: '16'
6668
distribution: 'adopt'
67-
cache: gradle
68-
- run: .\scripts\decodeAndWrite.ps1 -encodedValue $env:ENCODED_VALUE -outputPath $env:OUTPUT_PATH
69+
cache: gradle
70+
- name: Download file
71+
run: .\scripts\decodeAndWrite.ps1 -encodedValue $env:ENCODED_VALUE -outputPath $env:OUTPUT_PATH
6972
shell: pwsh
7073
env:
7174
ENCODED_VALUE: ${{ secrets.LOCAL_PROPERTIES }}
72-
OUTPUT_PATH: '.\local.properties'
73-
- run: .\scripts\decodeAndWrite.ps1 -encodedValue $env:ENCODED_VALUE -outputPath $env:OUTPUT_PATH
75+
OUTPUT_PATH: '.\local.properties'
76+
- name: Download file
77+
run: .\scripts\decodeAndWrite.ps1 -encodedValue $env:ENCODED_VALUE -outputPath $env:OUTPUT_PATH
7478
shell: pwsh
7579
env:
7680
ENCODED_VALUE: ${{ secrets.SECRING_GPG }}
@@ -95,13 +99,18 @@ jobs:
9599
**/gradle/**
96100
Scripts/**
97101
98-
githubRelease:
102+
create_Tag:
99103
needs: maven_Release
100104
runs-on: ubuntu-latest
105+
env:
106+
RELEASE_TAG: ""
101107
steps:
102108
- uses: actions/checkout@v2
103-
- name: Download Build Artifact
104-
uses: actions/[email protected]
105-
with:
106-
name: drop
107-
path: drop
109+
- name: Get version
110+
run: .\scripts\getLatestVersion.ps1
111+
shell: pwsh
112+
- name: Create tag
113+
uses: rickstaa/[email protected]
114+
with:
115+
tag: $RELEASE_TAG
116+

.github/workflows/git-release.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v2
16+
- name: Download Build Artifact
17+
uses: dawidd6/[email protected]
18+
with:
19+
workflow: build-and-publish.yml
20+
workflow_conclusion: success
21+
branch: dev
22+
event: push
23+
name: drop
1624
- name: Github Release
1725
uses: anton-yurchenko/[email protected]
1826
env:

scripts/getLatestVersion.ps1

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

32+
33+
echo "RELEASE_TAG = $version" >> $GITHUB_ENV
3234
#Update the VERSION_STRING env variable and inform the user
33-
Write-Host "##vso[task.setVariable variable=VERSION_STRING]$($version)";
34-
Write-Host "Updated the VERSION_STRING enviornment variable with the current Gradle.Properties, $version"
35+
#Write-Host "##vso[task.setVariable variable=VERSION_STRING]$($version)";
36+
#Write-Host "Updated the VERSION_STRING enviornment variable with the current Gradle.Properties, $version"

0 commit comments

Comments
 (0)