use sbt-dynver (#27042)

This commit is contained in:
Arnout Engelen 2019-12-16 14:33:17 +01:00 committed by GitHub
parent b5576870fc
commit 3a35851fef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 11 deletions

View file

@ -54,7 +54,7 @@ Make sure you have completed the setup in `project/scripts/release`.
Nightly snapshot releases are created from master and published to Nightly snapshot releases are created from master and published to
https://repo.akka.io/snapshots by https://jenkins.akka.io:8498/job/akka-publish-nightly/ https://repo.akka.io/snapshots by https://jenkins.akka.io:8498/job/akka-publish-nightly/
To create snapshot versions manually, use `sbt clean stampVersion publish`. To create snapshot versions manually, use `sbt clean publish`.
The release artifacts are created in `akka-*/target/repository` and can be The release artifacts are created in `akka-*/target/repository` and can be
copied over to a maven server. If you have access, the Jenkins job at copied over to a maven server. If you have access, the Jenkins job at
https://jenkins.akka.io:8498/job/akka-publish-wip/ can be used to publish https://jenkins.akka.io:8498/job/akka-publish-wip/ can be used to publish

View file

@ -29,8 +29,12 @@ object AkkaBuild {
organization := "com.typesafe.akka", organization := "com.typesafe.akka",
Dependencies.Versions, Dependencies.Versions,
// use the same value as in the build scope // use the same value as in the build scope
// TODO #26675 this can be removed once we use sbt-dynver instead of timestamps
// everywhere
version := (version in ThisBuild).value) version := (version in ThisBuild).value)
// TODO #26675 this can be removed once we use sbt-dynver instead of timestamps
// everywhere
lazy val currentDateTime = { lazy val currentDateTime = {
// storing the first accessed timestamp in system property so that it will be the // storing the first accessed timestamp in system property so that it will be the
// same when build is reloaded or when using `+`. // same when build is reloaded or when using `+`.
@ -41,6 +45,8 @@ object AkkaBuild {
.format(ZonedDateTime.now(ZoneOffset.UTC))) .format(ZonedDateTime.now(ZoneOffset.UTC)))
} }
// TODO #26675 this can be removed once we use sbt-dynver instead of timestamps
// everywhere
def akkaVersion: String = { def akkaVersion: String = {
val default = "2.6-SNAPSHOT" val default = "2.6-SNAPSHOT"
sys.props.getOrElse("akka.build.version", default) match { sys.props.getOrElse("akka.build.version", default) match {
@ -50,6 +56,8 @@ object AkkaBuild {
} }
} }
// TODO #26675 this can be removed once we use sbt-dynver instead of timestamps
// everywhere
def akkaVersionFromFile(default: String): String = { def akkaVersionFromFile(default: String): String = {
val versionFile = "akka-actor/target/classes/version.conf" val versionFile = "akka-actor/target/classes/version.conf"
if (new File(versionFile).exists()) { if (new File(versionFile).exists()) {
@ -66,7 +74,6 @@ object AkkaBuild {
UnidocRoot.akkaSettings, UnidocRoot.akkaSettings,
Protobuf.settings, Protobuf.settings,
parallelExecution in GlobalScope := System.getProperty("akka.parallelExecution", parallelExecutionByDefault.toString).toBoolean, parallelExecution in GlobalScope := System.getProperty("akka.parallelExecution", parallelExecutionByDefault.toString).toBoolean,
version in ThisBuild := akkaVersion,
// used for linking to API docs (overwrites `project-info.version`) // used for linking to API docs (overwrites `project-info.version`)
ThisBuild / projectInfoVersion := { if (isSnapshot.value) "snapshot" else version.value } ThisBuild / projectInfoVersion := { if (isSnapshot.value) "snapshot" else version.value }
) )

View file

@ -24,3 +24,4 @@ addSbtPlugin("com.lightbend" % "sbt-whitesource" % "0.1.18")
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.3.1") // for maintenance of copyright file header addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.3.1") // for maintenance of copyright file header
addSbtPlugin("com.hpe.sbt" % "sbt-pull-request-validator" % "1.0.0") addSbtPlugin("com.hpe.sbt" % "sbt-pull-request-validator" % "1.0.0")
addSbtPlugin("net.bzzt" % "sbt-reproducible-builds" % "0.22") addSbtPlugin("net.bzzt" % "sbt-reproducible-builds" % "0.22")
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.0.0")

View file

@ -251,7 +251,7 @@ declare -r current_version=$(get_current_version)
echolog "Current version is ${current_version}" echolog "Current version is ${current_version}"
if [ "${current_version:0:3}" != "${version:0:3}" ]; then if [ "${current_version:0:3}" != "${version:0:3}" ]; then
fail "Releasing $version from wrong with version $current_version" fail "Releasing $version from wrong branch with version $current_version"
fi fi
# start clean # start clean
@ -267,29 +267,29 @@ fi
# build the release # build the release
echolog "Building the release..." echolog "Building the release..."
if [ ! $dry_run ]; then if [ ! $dry_run ]; then
RELEASE_OPT="-Dakka.build.version=${version} -Dakka.genjavadoc.enabled=true -Dpublish.maven.central=true" RELEASE_OPT="-Dakka.genjavadoc.enabled=true -Dpublish.maven.central=true"
else else
RELEASE_OPT="-Dakka.build.version=${version} -Dakka.genjavadoc.enabled=true" RELEASE_OPT="-Dakka.genjavadoc.enabled=true"
fi fi
try sbt $RELEASE_OPT +buildRelease # tag this release
echolog "Tagging..."
try git tag -am "Version ${version}" v${version}
try sbt $RELEASE_OPT +buildRelease
try sbt $RELEASE_OPT buildDocs try sbt $RELEASE_OPT buildDocs
echolog "Successfully created local release" echolog "Successfully created local release"
# check binary compatibility for dry run # check binary compatibility for dry run
if [ ! $no_mima ] && [ $dry_run ]; then if [ ! $no_mima ] && [ $dry_run ]; then
echodry "Running migration manager report..." echodry "Running migration manager report..."
sbt $RELEASE_OPT +mimaReportBinaryIssues try sbt $RELEASE_OPT +mimaReportBinaryIssues
echodry "Finished migration manager report" echodry "Finished migration manager report"
fi fi
try sbt $RELEASE_OPT whitesourceCheckPolicies try sbt $RELEASE_OPT whitesourceCheckPolicies
# commit and tag this release
echolog "Tagging..."
try git tag -am "Version ${version}" v${version}
# the point of no return... we're now pushing out to servers # the point of no return... we're now pushing out to servers
# use a special failure from now on # use a special failure from now on