Skip to content

Commit

Permalink
build: Akka 2.9.3-M3 and publish to Akka repo (#3021)
Browse files Browse the repository at this point in the history
* remove deprecated in ElasticsearchConnectionSettings
* Akka HTTP 10.6.0-M2
  • Loading branch information
patriknw authored Oct 9, 2023
1 parent bc9b749 commit 29ecc13
Show file tree
Hide file tree
Showing 9 changed files with 96 additions and 49 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ jobs:
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
run: sbt ci-release
PUBLISH_USER: ${{ secrets.PUBLISH_USER }}
PUBLISH_PASSWORD: ${{ secrets.PUBLISH_PASSWORD }}
run: sbt +publishSigned

documentation:
# runs on main repo only
Expand Down
16 changes: 10 additions & 6 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import com.geirsson.CiReleasePlugin

lazy val alpakka = project
.in(file("."))
.enablePlugins(ScalaUnidocPlugin)
.disablePlugins(MimaPlugin, SitePlugin)
.disablePlugins(MimaPlugin, SitePlugin, CiReleasePlugin)
.aggregate(
amqp,
avroparquet,
Expand Down Expand Up @@ -469,7 +471,7 @@ def alpakkaProject(projectId: String, moduleName: String, additionalSettings: sb
import com.typesafe.tools.mima.core._
Project(id = projectId, base = file(projectId))
.enablePlugins(AutomateHeaderPlugin)
.disablePlugins(SitePlugin)
.disablePlugins(SitePlugin, CiReleasePlugin)
.settings(
name := s"akka-stream-alpakka-$projectId",
licenses := {
Expand Down Expand Up @@ -498,10 +500,12 @@ def alpakkaProject(projectId: String, moduleName: String, additionalSettings: sb
def internalProject(projectId: String, additionalSettings: sbt.Def.SettingsDefinition*): Project =
Project(id = projectId, base = file(projectId))
.enablePlugins(AutomateHeaderPlugin)
.disablePlugins(SitePlugin, MimaPlugin)
.settings(name := s"akka-stream-alpakka-$projectId",
publish / skip := true,
scalacOptions += "-Wconf:cat=deprecation&msg=.*JavaConverters.*:s")
.disablePlugins(SitePlugin, MimaPlugin, CiReleasePlugin)
.settings(
name := s"akka-stream-alpakka-$projectId",
publish / skip := true,
scalacOptions += "-Wconf:cat=deprecation&msg=.*JavaConverters.*:s"
)
.settings(additionalSettings: _*)

Global / onLoad := (Global / onLoad).value.andThen { s =>
Expand Down
6 changes: 3 additions & 3 deletions docs/release-train-issue-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ Key links:
- [ ] Update the revision in Fossa in the Akka Group for the Akka umbrella version, e.g. `22.10`. Note that the revisions for the release is udpated by Akka Group > Projects > Edit. For recent dependency updates the Fossa validation can be triggered from the GitHub actions "Dependency License Scanning".
- [ ] Wait until [main build finished](https://github.com/akka/alpakka/actions) after merging the latest PR
- [ ] Update the [draft release](https://github.com/akka/alpakka/releases) with the next tag version `v$VERSION$`, title and release description. Use the `Publish release` button, which will create the tag.
- [ ] Check that GitHub Actions release build has executed successfully (GitHub Actions will start a [CI build](https://github.com/akka/alpakka/actions) for the new tag and publish artifacts to Maven central via Sonatype)
- [ ] Check that GitHub Actions release build has executed successfully (GitHub Actions will start a [CI build](https://github.com/akka/alpakka/actions) for the new tag and publish artifacts to https://repo.akka.io/maven)

### Check availability

- [ ] Check [API](https://doc.akka.io/api/alpakka/$VERSION$/) documentation
- [ ] Check [reference](https://doc.akka.io/docs/alpakka/$VERSION$/) documentation. Check that the reference docs were deployed and show a version warning (see section below on how to fix the version warning).
- [ ] Check the release on [Maven central](https://repo1.maven.org/maven2/com/lightbend/akka/akka-stream-alpakka-xml_2.13/$VERSION$/)
- [ ] Check the release on https://repo.akka.io/maven/com/lightbend/akka/akka-stream-alpakka-xml_2.13/$VERSION$/akka-stream-alpakka-xml_2.13-$VERSION$.pom

### When everything is on maven central
### When everything is on https://repo.akka.io/maven
- [ ] Log into `gustav.akka.io` as `akkarepo`
- [ ] If this updates the `current` version, run `./update-alpakka-current-version.sh $VERSION$`
- [ ] otherwise check changes and commit the new version to the local git repository
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Remove deprecated
ProblemFilters.exclude[DirectMissingMethodProblem]("akka.stream.alpakka.elasticsearch.ElasticsearchConnectionSettings.withConnectionContext")
ProblemFilters.exclude[DirectMissingMethodProblem]("akka.stream.alpakka.elasticsearch.ElasticsearchConnectionSettings.withConnectionContext")
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@ package akka.stream.alpakka.elasticsearch
import akka.http.scaladsl.{ConnectionContext, HttpsConnectionContext}
import akka.http.scaladsl.model.HttpHeader
import akka.http.scaladsl.model.HttpHeader.ParsingResult
import akka.japi.Util

import scala.collection.JavaConverters._
import javax.net.ssl.SSLContext
import scala.compat.java8.OptionConverters

final class ElasticsearchConnectionSettings private (
val baseUrl: String,
Expand Down Expand Up @@ -47,30 +45,6 @@ final class ElasticsearchConnectionSettings private (
copy(headers = scalaHeaders)
}

/** Scala API */
@deprecated("prefer ElasticsearchConnectionSettings.withSSLContext", "3.1.0")
@Deprecated
def withConnectionContext(connectionContext: HttpsConnectionContext): ElasticsearchConnectionSettings =
copy(connectionContext = Option(connectionContext))

/** Java API */
@deprecated("prefer ElasticsearchConnectionSettings.withSSLContext", "3.1.0")
@Deprecated
def withConnectionContext(
connectionContext: akka.http.javadsl.HttpsConnectionContext
): ElasticsearchConnectionSettings = {
val scalaContext = new HttpsConnectionContext(
connectionContext.getSslContext,
None,
OptionConverters.toScala(connectionContext.getEnabledCipherSuites).map(Util.immutableSeq(_)),
OptionConverters.toScala(connectionContext.getEnabledProtocols).map(Util.immutableSeq(_)),
OptionConverters.toScala(connectionContext.getClientAuth),
OptionConverters.toScala(connectionContext.getSslParameters)
)

copy(connectionContext = Option(scalaContext))
}

def withSSLContext(
sslContext: SSLContext
): ElasticsearchConnectionSettings = {
Expand Down
7 changes: 4 additions & 3 deletions project/Common.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import de.heikoseeberger.sbtheader.HeaderPlugin.autoImport._
import com.lightbend.paradox.projectinfo.ParadoxProjectInfoPluginKeys._
import com.lightbend.sbt.JavaFormatterPlugin.autoImport.javafmtOnCompile
import com.typesafe.tools.mima.plugin.MimaKeys._
import xerial.sbt.Sonatype.autoImport.sonatypeProfileName
import sbtdynver.DynVerPlugin.autoImport.dynverSonatypeSnapshots

object Common extends AutoPlugin {

Expand Down Expand Up @@ -123,6 +123,8 @@ object Common extends AutoPlugin {
Seq("-Werror")
case _ => Seq.empty[String]
}),
resolvers += "Akka library repository".at("https://repo.akka.io/maven"),
dynverSonatypeSnapshots := true,
autoAPIMappings := true,
apiURL := Some(url(s"https://doc.akka.io/api/alpakka/${version.value}/akka/stream/alpakka/index.html")),
// show full stack traces and test case durations
Expand All @@ -139,7 +141,6 @@ object Common extends AutoPlugin {
javafmtOnCompile := false,
headerLicense := Some(
HeaderLicense.Custom("Copyright (C) since 2016 Lightbend Inc. <https://www.lightbend.com>")
),
sonatypeProfileName := "com.lightbend"
)
)
}
13 changes: 6 additions & 7 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ object Dependencies {
val Scala2Versions = Seq(Scala213)
val ScalaVersions = Dependencies.Scala2Versions :+ Dependencies.Scala3

val AkkaVersion = "2.8.1"
val AkkaBinaryVersion = "2.8"
val AkkaVersion = "2.9.0-M3"
val AkkaBinaryVersion = "2.9"

val InfluxDBJavaVersion = "2.15"

val AwsSdk2Version = "2.17.295"
val AwsSpiAkkaHttpVersion = "1.0.1"
val ProtobufJavaVersion = "3.21.12"
// Sync with plugins.sbt
val AkkaGrpcBinaryVersion = "2.3"
val AkkaGrpcBinaryVersion = "2.4"
// sync ignore prefix in scripts/link-validator.conf#L30
val AkkaHttpVersion = "10.5.1"
val AkkaHttpBinaryVersion = "10.5"
val AlpakkaKafkaVersion = "4.0.2"
val AkkaHttpVersion = "10.6.0-M2"
val AkkaHttpBinaryVersion = "10.6"
val AlpakkaKafkaVersion = "5.0.0-M1"
val ScalaTestVersion = "3.2.15"
val TestContainersScalaTestVersion = "0.40.3" // pulls Testcontainers 1.16.2
val mockitoVersion = "4.8.1" // check even https://github.com/scalatest/scalatestplus-mockito/releases
Expand Down Expand Up @@ -234,7 +234,6 @@ object Dependencies {
"org.apache.arrow" % "arrow-vector" % "4.0.0" % "provided",
"io.grpc" % "grpc-auth" % akka.grpc.gen.BuildInfo.grpcVersion, // ApacheV2
"com.typesafe.akka" %% "akka-http-spray-json" % AkkaHttpVersion,
"com.typesafe.akka" %% "akka-http2-support" % AkkaHttpVersion,
"org.apache.arrow" % "arrow-memory-netty" % "4.0.1" % Test,
"com.typesafe.akka" %% "akka-discovery" % AkkaVersion
) ++ Mockito
Expand Down
64 changes: 64 additions & 0 deletions project/Publish.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
* Copyright (C) 2023 Lightbend Inc. <https://www.lightbend.com>
*/

import java.util.concurrent.atomic.AtomicBoolean

import scala.language.postfixOps

import sbt.{Def, _}
import Keys._
import com.geirsson.CiReleasePlugin
import com.jsuereth.sbtpgp.PgpKeys.publishSigned
import xerial.sbt.Sonatype.autoImport.sonatypeProfileName

/**
* For projects that are not published.
*/
object NoPublish extends AutoPlugin {
override def requires = plugins.JvmPlugin

override def projectSettings =
Seq(publish / skip := true, publishArtifact := false, publish := {}, publishLocal := {})
}

object Publish extends AutoPlugin {
override def requires = plugins.JvmPlugin && Common
override def trigger = AllRequirements

lazy val beforePublishTask = taskKey[Unit]("setup before publish")

lazy val beforePublishDone = new AtomicBoolean(false)

def beforePublish(snapshot: Boolean) = {
if (beforePublishDone.compareAndSet(false, true)) {
CiReleasePlugin.setupGpg()
if (!snapshot)
cloudsmithCredentials(validate = true)
}
}

override def projectSettings: Seq[Def.Setting[_]] =
Seq(
sonatypeProfileName := "com.lightbend",
beforePublishTask := beforePublish(isSnapshot.value),
publishSigned := publishSigned.dependsOn(beforePublishTask).value,
publishTo := (if (isSnapshot.value)
Some(Resolver.file("file", target.value / "repository")) // FIXME snapshot repo
else
Some("Cloudsmith API".at("https://maven.cloudsmith.io/lightbend/akka/"))),
credentials ++= (if (isSnapshot.value) Seq[Credentials]() else cloudsmithCredentials(validate = false))
)

def cloudsmithCredentials(validate: Boolean): Seq[Credentials] = {
(sys.env.get("PUBLISH_USER"), sys.env.get("PUBLISH_PASSWORD")) match {
case (Some(user), Some(password)) =>
Seq(Credentials("Cloudsmith API", "maven.cloudsmith.io", user, password))
case _ =>
if (validate)
throw new Exception("Publishing credentials expected in `PUBLISH_USER` and `PUBLISH_PASSWORD`.")
else
Nil
}
}
}
4 changes: 3 additions & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
resolvers += "Akka library repository".at("https://repo.akka.io/maven")

addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.4")
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.1.1")
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.7")
Expand All @@ -14,6 +16,6 @@ addSbtPlugin("com.github.sbt" % "sbt-unidoc" % "0.5.0")
addSbtPlugin("com.thoughtworks.sbt-api-mappings" % "sbt-api-mappings" % "3.0.2")
addSbtPlugin("com.github.sbt" % "sbt-site-paradox" % "1.5.0")
// Akka gRPC -- sync with version in Dependencies.scala:22
addSbtPlugin("com.lightbend.akka.grpc" % "sbt-akka-grpc" % "2.3.1")
addSbtPlugin("com.lightbend.akka.grpc" % "sbt-akka-grpc" % "2.4.0-M1")
// templating
addSbtPlugin("io.spray" % "sbt-boilerplate" % "0.6.1")

0 comments on commit 29ecc13

Please sign in to comment.