From ad227d2ca91ac035c814dbf09fa9ac02c141ba8d Mon Sep 17 00:00:00 2001 From: Tim van der Lippe Date: Sat, 14 Jun 2025 15:51:51 +0200 Subject: [PATCH 1/2] Add back project version Turns out it is required to generate the pom and jars in the right location with the correct version. --- .github/workflows/ci.yml | 4 +++- build.gradle | 6 ++++++ build.sbt | 2 ++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2f888685..6a87c6f9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -82,7 +82,9 @@ jobs: java-version: 17 - name: Build and publish to Bintray/MavenCentral - run: ./build.sh + run: ./gradlew writeActualVersion + && export PROJECT_VERSION=`cat version.actual` + && ./build.sh && ./gradlew publishToSonatype githubRelease closeAndReleaseStagingRepositories releaseSummary env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/build.gradle b/build.gradle index e4492898..483282ca 100644 --- a/build.gradle +++ b/build.gradle @@ -111,6 +111,12 @@ tasks { } } +tasks.register("writeActualVersion") { + doLast { + file("version.actual") << "$version" + } +} + tasks.register("releaseSummary") { doLast { if (isSnapshot) { diff --git a/build.sbt b/build.sbt index e201a9b7..ba05c455 100644 --- a/build.sbt +++ b/build.sbt @@ -7,6 +7,8 @@ val currentScalaVersion = "2.13.16" inThisBuild( Seq( scalaVersion := currentScalaVersion, + // Load version from the file so that Gradle/Shipkit and SBT use the same version + version := sys.env.get("PROJECT_VERSION").get ) ) From e1f896650ba0bbcbf15d25f26514c5ad19e62c41 Mon Sep 17 00:00:00 2001 From: Tim van der Lippe Date: Sat, 14 Jun 2025 15:55:40 +0200 Subject: [PATCH 2/2] Add fallback version --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index ba05c455..b4d40fa4 100644 --- a/build.sbt +++ b/build.sbt @@ -8,7 +8,7 @@ inThisBuild( Seq( scalaVersion := currentScalaVersion, // Load version from the file so that Gradle/Shipkit and SBT use the same version - version := sys.env.get("PROJECT_VERSION").get + version := sys.env.getOrElse("PROJECT_VERSION", "0.1.0") ) )