From 6f502b6c315c3848e8078667dc703358308316f9 Mon Sep 17 00:00:00 2001 From: Johannes Rudolph Date: Mon, 19 Apr 2021 14:36:15 +0200 Subject: [PATCH 1/3] build: publish to sonatype directly (#3792) (cherry picked from commit b7f057da0923393c290a778e5043169ee88e0bef) --- .travis.yml | 7 ++++++- build.sbt | 16 ++++++++-------- project/Formatting.scala | 1 - project/Publish.scala | 19 ++++++++----------- project/plugins.sbt | 2 +- scripts/release-train-issue-template.md | 4 +--- 6 files changed, 24 insertions(+), 25 deletions(-) diff --git a/.travis.yml b/.travis.yml index 67afc816132..d92dfaa9f9c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,6 +28,10 @@ cache: - $HOME/.jabba/jdk - $HOME/.cache/coursier +env: + # override default (release to maven central) to only close and go to staging repo + - CI_SONATYPE_RELEASE="; sonatypePrepare; sonatypeBundleUpload; sonatypeClose" + script: - jabba use "adopt@1.8-0" - java -version @@ -40,7 +44,8 @@ jobs: - stage: whitesource script: git branch -f "$TRAVIS_BRANCH" && git checkout "$TRAVIS_BRANCH" && sbt whitesourceCheckPolicies whitesourceUpdate - stage: publish - env: CMD="+publish" + env: CMD="ci-release" + name: artifacts to bintray stages: - name: mima diff --git a/build.sbt b/build.sbt index a93f99d11ae..9d8645aebcd 100644 --- a/build.sbt +++ b/build.sbt @@ -43,7 +43,7 @@ lazy val root = Project( base = file(".") ) .enablePlugins(UnidocRoot, NoPublish, DeployRsync, AggregatePRValidation) - .disablePlugins(BintrayPlugin, MimaPlugin) + .disablePlugins(MimaPlugin) .settings( // Unidoc doesn't like macro definitions unidocProjectExcludes := Seq(parsing), @@ -138,7 +138,6 @@ lazy val parsing = project("akka-parsing") .settings( scalacOptions --= Seq("-Xfatal-warnings", "-Xlint", "-Ywarn-dead-code"), // disable warnings for parboiled code scalacOptions += "-language:_", - unmanagedSourceDirectories in ScalariformKeys.format in Test := (unmanagedSourceDirectories in Test).value ) .settings(scalaMacroSupport) .enablePlugins(ScaladocNoVerificationOfDiagrams) @@ -242,7 +241,7 @@ lazy val httpTests = project("akka-http-tests") .settings(Dependencies.httpTests) .dependsOn(httpSprayJson, httpXml, httpJackson, httpTestkit % "test", httpCore % "test->test") - .enablePlugins(NoPublish).disablePlugins(BintrayPlugin) // don't release tests + .enablePlugins(NoPublish) // don't release tests .enablePlugins(MultiNode) .disablePlugins(MimaPlugin) // this is only tests .configs(MultiJvm) @@ -256,13 +255,13 @@ lazy val httpJmhBench = project("akka-http-bench-jmh") .dependsOn(http) .addAkkaModuleDependency("akka-stream") .enablePlugins(JmhPlugin) - .enablePlugins(NoPublish).disablePlugins(BintrayPlugin) // don't release benchs + .enablePlugins(NoPublish) // don't release benchs .disablePlugins(MimaPlugin) lazy val httpMarshallersScala = project("akka-http-marshallers-scala") .settings(commonSettings) .enablePlugins(NoPublish/*, AggregatePRValidation*/) - .disablePlugins(BintrayPlugin, MimaPlugin) + .disablePlugins(MimaPlugin) .aggregate(httpSprayJson, httpXml) lazy val httpXml = @@ -280,7 +279,7 @@ lazy val httpSprayJson = lazy val httpMarshallersJava = project("akka-http-marshallers-java") .settings(commonSettings) .enablePlugins(NoPublish/*, AggregatePRValidation*/) - .disablePlugins(BintrayPlugin, MimaPlugin) + .disablePlugins(MimaPlugin) .aggregate(httpJackson) lazy val httpJackson = @@ -322,9 +321,10 @@ def httpMarshallersJavaSubproject(name: String) = lazy val docs = project("docs") .enablePlugins(AkkaParadoxPlugin, NoPublish, DeployRsync) - .disablePlugins(BintrayPlugin, MimaPlugin) + .disablePlugins(MimaPlugin) .addAkkaModuleDependency("akka-stream", "provided") .addAkkaModuleDependency("akka-actor-typed", "provided", includeIfScalaVersionMatches = _ != "2.11") // no akka-actor-typed in 2.11 any more + .dependsOn( httpCore, http, httpXml, http2Support, httpMarshallersJava, httpMarshallersScala, httpCaching, httpTests % "compile;test->test", httpTestkit % "compile;test->test" @@ -379,7 +379,7 @@ lazy val docs = project("docs") lazy val compatibilityTests = Project("akka-http-compatibility-tests", file("akka-http-compatibility-tests")) .enablePlugins(NoPublish) - .disablePlugins(BintrayPlugin, MimaPlugin) + .disablePlugins(MimaPlugin) .addAkkaModuleDependency("akka-stream", "provided") .settings( libraryDependencies ++= Seq( diff --git a/project/Formatting.scala b/project/Formatting.scala index a40744eeff5..e31b34e9f8c 100644 --- a/project/Formatting.scala +++ b/project/Formatting.scala @@ -14,7 +14,6 @@ object Formatting { lazy val formatSettings = Seq( ScalariformKeys.preferences := setPreferences(ScalariformKeys.preferences.value), ScalariformKeys.preferences in Compile := setPreferences(ScalariformKeys.preferences.value), - ScalariformKeys.preferences in Test := setPreferences(ScalariformKeys.preferences.value), ScalariformKeys.preferences in MultiJvm := setPreferences(ScalariformKeys.preferences.value) ) diff --git a/project/Publish.scala b/project/Publish.scala index 44cdc57c386..16f55a027d6 100644 --- a/project/Publish.scala +++ b/project/Publish.scala @@ -5,7 +5,9 @@ package akka import scala.language.postfixOps -import sbt._, Keys._ +import sbt.{Def, _} +import Keys._ +import xerial.sbt.Sonatype.autoImport.sonatypeProfileName /** * For projects that are not published. @@ -14,24 +16,19 @@ object NoPublish extends AutoPlugin { override def requires = plugins.JvmPlugin override def projectSettings = Seq( + skip in publish := true, publishArtifact := false, publish := {}, publishLocal := {} ) - } object Publish extends AutoPlugin { - import bintray.BintrayPlugin - import bintray.BintrayPlugin.autoImport._ - - override def trigger = allRequirements - override def requires = BintrayPlugin + override def requires = plugins.JvmPlugin + override def trigger = AllRequirements - override def projectSettings = Seq( - bintrayOrganization := Some("akka"), - bintrayPackage := "akka-http", - bintrayRepository := (if (isSnapshot.value) "snapshots" else "maven") + override def projectSettings: Seq[Def.Setting[_]] = Seq( + sonatypeProfileName := "com.typesafe", ) } diff --git a/project/plugins.sbt b/project/plugins.sbt index a151a1021b7..ac171b0cf1e 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -16,11 +16,11 @@ addSbtPlugin("com.thoughtworks.sbt-api-mappings" % "sbt-api-mappings" % "3.0.0") addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.3.7") addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.10.0-RC1") // for advanced PR validation features addSbtPlugin("io.spray" % "sbt-boilerplate" % "0.6.1") -addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.6") addSbtPlugin("com.lightbend.sbt" % "sbt-javaagent" % "0.1.5") addSbtPlugin("com.lightbend.akka" % "sbt-paradox-akka" % "0.32") addSbtPlugin("com.lightbend" % "sbt-whitesource" % "0.1.18") addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.4.0") +addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.7") // used in ValidatePullRequest to check github PR comments whether to build all subprojects libraryDependencies += "org.kohsuke" % "github-api" % "1.106" diff --git a/scripts/release-train-issue-template.md b/scripts/release-train-issue-template.md index 09438e5b49a..ac6c0195df3 100644 --- a/scripts/release-train-issue-template.md +++ b/scripts/release-train-issue-template.md @@ -44,9 +44,7 @@ Wind down PR queue. There has to be enough time after the last (non-trivial) PR - [ ] Wait until [master build finished](https://travis-ci.org/akka/akka-http/builds/) after merging the release notes - [ ] Create a [new release](https://github.com/akka/akka-http/releases/new) with the next tag version (e.g. `v13.3.7`), title and release description linking to announcement, release notes and milestone. - [ ] Check that the Travis CI [release build](https://travis-ci.org/akka/akka-http/branches) has executed successfully -- [ ] Go to https://bintray.com/akka/maven/akka-http and select the just released version -- [ ] Go to the Maven Central tab and sync with Sonatype. You may need to log in and switch to the 'Old Look' for this. -- [ ] Log in to Sonatype to Close the staging repository (optional, should happen automatically if selected in Bintray) +- [ ] Log in to Sonatype to Close the staging repository - [ ] Notify Telemetry / Play team to check against staged artifacts - [ ] Run a test against the staging repository to make sure the release went well, for example by using https://github.com/akka/akka-http-quickstart-scala.g8 and adding the sonatype staging repo with `resolvers += "Staging Repo" at "https://oss.sonatype.org/content/repositories/comtypesafe-xxx"` - [ ] Release the staging repository to Maven Central. From 5dc5ab1a54b1b4dea3109564d4f3f4ab1e54a0ee Mon Sep 17 00:00:00 2001 From: Johannes Rudolph Date: Mon, 19 Apr 2021 16:20:16 +0200 Subject: [PATCH 2/3] build: replace jabba by proper debian installation (#3539) (cherry picked from commit 6a5b1fbc4ca0c2661720b43220d89e26bdc5f9eb) --- .travis.yml | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/.travis.yml b/.travis.yml index d92dfaa9f9c..4c82bd55f5f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,8 @@ +version: ~> 1.0 + +os: linux +dist: xenial + language: scala scala: @@ -8,14 +13,18 @@ sudo: false before_install: # make comparing to origin/master work - git remote set-branches --add origin master && git fetch - # using jabba for custom jdk management - - curl -sL https://raw.githubusercontent.com/shyiko/jabba/0.11.1/install.sh | bash && . ~/.jabba/jabba.sh - - jabba install adopt@1.8-0 + - whereis java + - java -version addons: apt: + sources: + # Official debian package for AdoptOpenJDK from https://adoptopenjdk.net/installation.html#linux-pkg + - sourceline: deb https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/ xenial main + key_url: https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public packages: - - graphviz + - graphviz + - adoptopenjdk-8-hotspot before_cache: - find $HOME/.ivy2 -name "ivydata-*.properties" -print -delete @@ -25,12 +34,14 @@ cache: directories: - $HOME/.ivy2/cache - $HOME/.sbt/boot - - $HOME/.jabba/jdk - $HOME/.cache/coursier env: - # override default (release to maven central) to only close and go to staging repo - - CI_SONATYPE_RELEASE="; sonatypePrepare; sonatypeBundleUpload; sonatypeClose" + global: + - JAVA_HOME=/usr/lib/jvm/adoptopenjdk-8-hotspot-amd64 + - PATH=/usr/lib/jvm/adoptopenjdk-8-hotspot-amd64/bin:$PATH + # override default (release to maven central) to only close and go to staging repo + - CI_SONATYPE_RELEASE="; sonatypePrepare; sonatypeBundleUpload; sonatypeClose" script: - jabba use "adopt@1.8-0" @@ -55,16 +66,3 @@ stages: - name: publish if: repo=akka/akka-http AND ( ( (branch = master OR branch = release-10.1) AND type = push ) OR tag =~ ^v ) - -env: - global: - # encrypt with: travis encrypt WHITESOURCE_PASSWORD=... - - secure: "O3bUB/B1CusDUGTcGaMndQK2nPw+XK5GMrecQ9awLCtnX6bkqSdX18pK9l2XP8r7yR+DYyFoyknf1rJ6JiybsBrc3udNpSBBTTG+4EMAMK12kxiQmy82JEepZrD/BkGtmMhzD6X41s+J2tY0XDa6p/Xqbr2Hb+oTQ7+WXdhfwyfdrszUcEL/t1IrdI2jgh37NJlBMuoHUWOXanpVv6KR7Kfjahd34k79bbfEK/8sX4kv7YU7uZWe/UxJse1b767sbijAqInFm+3n3lxv8eqnbbaAcdTuZBYkwkf5uZcXmV/Px1xupPBt1C6k49vfogT148KxJ7CzYawAC3oZq10m8I/6NREPUpoLN6ie+K9g3P+FcvCbKju8sxaoYmxNW+V+r6B/I+mXrbpD5YHT7WpvfF9gZt3HJk3V6/+Cu9vvgrnTGkUYymTWymEGRRq5TB2Q+/IDR7Qq8XTwkzA7UwcQ3WBotVY7TQKMEp9LvILTBnP0GZiUfeq+OXzLUN7sjsaEevD1dV0ZkIeILAFDwEmzPXKlmV70+IIM+Km8uCZ4XJ6GOklnEar+zltwBdFPrcvC6Pcb77O02DeMz773Uu9PxXgdUcjsW06v0wUO+5KXB9Y+6+9SJtW0gs5BtaiUnY7d38YPoXWq9Gm+sNUnJe5NH/nBdjF/O8xqAhUgs0OPApE=" - # encrypt with: travis encrypt BINTRAY_USER=... - - secure: "cF1u1wF3Jhn5sfMATA6PltwUdfohX4TMtqluqWtZ5ZhKknIphMa9qmwpyVjaymO9dbEoBTejhGJdvxtwezkHE9K2rYGGP5o5BnOBNrbwY6+Z3FP+woHLUJrLKCL5cQvW+ReVmms7NyE4kH/2ngqXYb9MPHbs8RMXvdjclrZVWaIdyEE1TMb9TBI4F/oEpBY2Gee1eN3n6V7C01prCmrBdA0PHzqDyWIr/Axy+6ok6Fmou1bysSGjYl1aTRZFng/nNBO/smm6HoC9Pxj+uesZjaF0SaS/oce5ke9xefyW93lr024A300sJzVAEpexLgBBGMTupd3hLBRygPbY0B9yH4jPIElM0gRNt65BiV12PNhvRTyFm+OUwDPFiCjD8ttsZWAix5/81nIODMqu1HqViqdY5XQhmJmVjfjXSZHi+IDia2LDWxtq+bJ17YHnCtoGCGHTYbaYuwaESx23HZ90GvSwCtG5p8e7HSB0BUkgDj9BcjI1WQZRoIh8/KFBR04G1hHWt8cLKvefAiN//d+8RaoEza1THkZZqfYYr91QEDJ1xxtUnjKIc24i8FTSvDUJUkCF5xviKiaDzhdaBIIhJDuFJDgzDfQa7ttktkAFuY553fFxHYQVSK2l/FA2WojfEOzlbegKEXe5INfL9AgWLddnVdXtWulAf3hCb7v/WJo=" - # encrypt with: travis encrypt BINTRAY_PASS=... - - secure: "ZBEa9eGU+jb6kXh1D53hw0oDIVss1vGMb0boBnQkoGnUI3DLnWbL0x+xNL6yH7V9trl7VnO2XWS+aT+PkY0yZHw1oymwiEwd0wESSrEyY7SwdjYrod+91Y8Yn1e7kainfXs2mH8P0kpKahw/kHZp0o0mEoucYj05zPNAkb2sK56+rzvJ5ohV8fF1k79xLpuJ6RMhDKX2ip/+DGUn5t9SD+tshRY134yh7A8BKcUtPEp30VTaA64+EuVweNtqdonsgCAAoyEei5D6id6tCyqGGnN1c+UXSW5QHunM2LTVGaCi9W3Zm71HCB34YSVsTtTW3CxSWIjsA2yi4HypojPebH3sUpDiBMtbqt2fVpMHjcVDRX5x+p3L2n7GKcWBDTDiCS7YXktzTvZPRyDNL2EZIPpOBDdAAEIkUNP9JjpH47S6lCjsLRFk1JPeBLSfwn3GqUOsvErNDw+VEZ4FQ8wJhptnJcjSUT4pqaRp3KoVMjA1SqajOHelMaIEw1qkH1mvGebVwXVkd86IfY+L6roJi/NwBbSvpovMCfZTTEpApc4AldBFapno3aWHpVkAYWTpv1d39cmzGo3UwKmSAqHMcJPGAB87gW8lzNU8LkCesQ6q46rRT5hJVdbAzf8H4TgYXwObJ6mp6U5IfdXwEcoELdIFI+CMVo09/WteJfW8bB8=" - # encrypt with: travis encrypt SONATYPE_USER=... - - secure: "OCg+rBabEUkV4wi4Bd5FwJzJKC5ED/12y/WY4HGvcdYv4M3Skd6uPrgGKc+daYY1Hmk+uDb3G5mqpqdjrb1uAA/bWuTqVUoeXKp/nlegRChK04bX38sVe5P88/nTIrar0SWTgpa2HfAc6q1cNVSnD60SyOM2FzJ5IPpejT94ajwdAARbZYpKP8tGGtU7Mf0+JmJ+yBJW1tM2vOrLYaqXZ+KE4x7QLHRtTLbeuUmgAbzhah6oVyoG5RwX2bRr2+4lwEGVEEHws/qzWt6eOYSx2v5HNL2XDy5ISXoPjsVuexf1G5nwspoKR8sdzQasCUyMOSTYR6iNdj62NjAYNI+MOqANx0pcC7opUNyuAwJYbvZQXYRLLBFZTL+tDBV7LKutJxbdDcSPh4aMKHRoyTXklDfPP+a4EJuzHbcI5q0b9GktGadfTYVca4TjVnu4pP9R/lXZUTYBzWFpe/Tsy963aDWY5mioZIDshP2XDUR9aol6yQghHkIT4dtglmTuoLUT+v35i0P6YZFUnA37kfBN/x4X0FzYJa0X/zg+K9aGmuq4wxhnAPVYgFzsz2hN4AewnORiyMcm5FrG3daJcWDUc6SB14ckcvuokGcPlLPkPEtStM9l47UEI7RZ8llFoqkFjA37yHtXBupfgIP+GzErNLDFtvtvEqtOYS75urWzmyk=" - # encrypt with: travis encrypt SONATYPE_PASS=... - - secure: "X7oP/QFd6LxlsCMOLj75G5KefxmpyUnKpPA1+T5WU2jD3XXsU1JrxeVj3NSIWXNT/QuzcOBPT982kKClAGgmyOVcVfcHwxxL2a5zQRFGEx5Z14wQo83b45oLAFXnaTZQjLHzY2kzIaEkpEuAqmMzzWNgIo2smJEYYy2YbenWTGCj8Lj6pyV7XbV9vvXIcNoSTA0HBsTCGz+gif2WAxh5aASsRjdpkk7fTQRwLibulvDbYccSJTGlE4P8YzVh6wlS2pzbfYBKWCVP0v4/xmOAdcglShCt1JcZmutomhtZtxyMU7zeSC6b0E7ZwP9wrtVSrRRQcxcB+Ai/N0h62bI6LhzHzd18FClNpYlTPvrJB5+SLAMrEbX/5COW3UTqt1yAhCDDw99SNJChtUrLJxJaG9Z+UnINT8vickP5Qd5YWnWED/Sn0OhzBNec2ini8rivDVrm4SEpvtfDxf+v4dAhHNMKE/E6xjvoe9InCba8VSMydfXWR00BTV9ePIKw3XzUbYtSmuZMdkZg2MzxS+kwhgTTwzlVGeo31zgIcNQgqkcyTE8FQLMiOXgO6xYRVDsOF7Ge6izQ2p/Fcx6dzIoH5hhQULJIA3Bj1RnlSssYHbta4kex8j8utHznY81qpvKAYwQiZ3AbKW305Gucb+3/ekMxsmkKm0+PRSBG/DUaAFo=" From 3ad12e31f7184950a35c220b691b49728250770f Mon Sep 17 00:00:00 2001 From: Johannes Rudolph Date: Mon, 19 Apr 2021 16:18:10 +0200 Subject: [PATCH 3/3] build: make sure launcher is downloaded from correct repo (cherry picked from commit abb6aa4b53bc7f64f888470c090158a2e3b105dd) --- .travis.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4c82bd55f5f..6f95386cec2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,6 +15,10 @@ before_install: - git remote set-branches --add origin master && git fetch - whereis java - java -version + # Initialize launcher from the correct URL so that later sbt runs work out of the box. + # Travis' default sbt launch script refers to `repo.scala-sbt.org` for downloading the launcher + # which currently doesn't work any more + - sbt -sbt-launch-repo https://repo1.maven.org/maven2 exit addons: apt: @@ -33,7 +37,7 @@ before_cache: cache: directories: - $HOME/.ivy2/cache - - $HOME/.sbt/boot + - $HOME/.sbt - $HOME/.cache/coursier env: @@ -44,8 +48,6 @@ env: - CI_SONATYPE_RELEASE="; sonatypePrepare; sonatypeBundleUpload; sonatypeClose" script: - - jabba use "adopt@1.8-0" - - java -version - sbt -jvm-opts .jvmopts-travis "$CMD" jobs: