Skip to content

Commit 4ac52b4

Browse files
committed
try to fix github workflow * 1
1 parent eaea5f8 commit 4ac52b4

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ jobs:
1818
distribution: 'adopt'
1919

2020
- name: Build with Gradle
21-
run: ./gradlew build shadowJar
21+
run: ./gradlew build shadowJar writeVersionToFile
2222

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
2626

2727
- name: Upload Artifact
2828
uses: actions/upload-artifact@v2

build.gradle.kts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,10 @@ tasks {
6363
}
6464
}
6565

66-
tasks.register("printVersion") {
66+
tasks.register("writeVersionToFile") {
6767
doLast {
68-
println(project.version)
68+
val versionFile = file("build/version.txt")
69+
versionFile.writeText(project.version.toString())
6970
}
7071
}
7172

0 commit comments

Comments
 (0)