File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -18,11 +18,11 @@ jobs:
18
18
distribution : ' adopt'
19
19
20
20
- name : Build with Gradle
21
- run : ./gradlew build shadowJar
21
+ run : ./gradlew build shadowJar writeVersionToFile
22
22
23
- - name : Get Version
24
- id : get_version
25
- run : echo "VERSION=$(./gradlew -q printVersion )" >> $GITHUB_ENV
23
+ - name : Read Version From File
24
+ id : read_version
25
+ run : echo "VERSION=$(cat build/version.txt )" >> $GITHUB_ENV
26
26
27
27
- name : Upload Artifact
28
28
uses : actions/upload-artifact@v2
Original file line number Diff line number Diff line change @@ -63,9 +63,10 @@ tasks {
63
63
}
64
64
}
65
65
66
- tasks.register(" printVersion " ) {
66
+ tasks.register(" writeVersionToFile " ) {
67
67
doLast {
68
- println (project.version)
68
+ val versionFile = file(" build/version.txt" )
69
+ versionFile.writeText(project.version.toString())
69
70
}
70
71
}
71
72
You can’t perform that action at this time.
0 commit comments