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..b4d40fa4 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.getOrElse("PROJECT_VERSION", "0.1.0") ) )