Skip to content

Commit ad227d2

Browse files
authored
Add back project version
Turns out it is required to generate the pom and jars in the right location with the correct version.
1 parent 6fd5bfd commit ad227d2

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ jobs:
8282
java-version: 17
8383

8484
- name: Build and publish to Bintray/MavenCentral
85-
run: ./build.sh
85+
run: ./gradlew writeActualVersion
86+
&& export PROJECT_VERSION=`cat version.actual`
87+
&& ./build.sh
8688
&& ./gradlew publishToSonatype githubRelease closeAndReleaseStagingRepositories releaseSummary
8789
env:
8890
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

build.gradle

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,12 @@ tasks {
111111
}
112112
}
113113

114+
tasks.register("writeActualVersion") {
115+
doLast {
116+
file("version.actual") << "$version"
117+
}
118+
}
119+
114120
tasks.register("releaseSummary") {
115121
doLast {
116122
if (isSnapshot) {

build.sbt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ val currentScalaVersion = "2.13.16"
77
inThisBuild(
88
Seq(
99
scalaVersion := currentScalaVersion,
10+
// Load version from the file so that Gradle/Shipkit and SBT use the same version
11+
version := sys.env.get("PROJECT_VERSION").get
1012
)
1113
)
1214

0 commit comments

Comments
 (0)