Skip to content

Commit

Permalink
Merge pull request #3801 from jrudolph/publish-to-sonatype-directly-1…
Browse files Browse the repository at this point in the history
…0.1 (#3801)

* build: publish to sonatype directly (#3792)


(cherry picked from commit b7f057d)

* build: replace jabba by proper debian installation (#3539)


(cherry picked from commit 6a5b1fb)

* build: make sure launcher is downloaded from correct repo

(cherry picked from commit abb6aa4)
  • Loading branch information
jrudolph authored Apr 19, 2021
2 parents 16e7249 + 3ad12e3 commit 971cf72
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 46 deletions.
49 changes: 27 additions & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
version: ~> 1.0

os: linux
dist: xenial

language: scala

scala:
Expand All @@ -8,14 +13,22 @@ 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 [email protected]
- 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:
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
Expand All @@ -24,13 +37,17 @@ before_cache:
cache:
directories:
- $HOME/.ivy2/cache
- $HOME/.sbt/boot
- $HOME/.jabba/jdk
- $HOME/.sbt
- $HOME/.cache/coursier

env:
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 "[email protected]"
- java -version
- sbt -jvm-opts .jvmopts-travis "$CMD"

jobs:
Expand All @@ -40,7 +57,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
Expand All @@ -50,16 +68,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+UXSW5QHunM2LTVGaC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EqtOYS75urWzmyk="
# 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="
16 changes: 8 additions & 8 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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 =
Expand All @@ -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 =
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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(
Expand Down
1 change: 0 additions & 1 deletion project/Formatting.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)

Expand Down
19 changes: 8 additions & 11 deletions project/Publish.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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",
)
}

Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 1 addition & 3 deletions scripts/release-train-issue-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 971cf72

Please sign in to comment.