Skip to content

Commit 29ecc13

Browse files
authored
build: Akka 2.9.3-M3 and publish to Akka repo (#3021)
* remove deprecated in ElasticsearchConnectionSettings * Akka HTTP 10.6.0-M2
1 parent bc9b749 commit 29ecc13

File tree

9 files changed

+96
-49
lines changed

9 files changed

+96
-49
lines changed

.github/workflows/publish.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ jobs:
3838
env:
3939
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
4040
PGP_SECRET: ${{ secrets.PGP_SECRET }}
41-
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
42-
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
43-
run: sbt ci-release
41+
PUBLISH_USER: ${{ secrets.PUBLISH_USER }}
42+
PUBLISH_PASSWORD: ${{ secrets.PUBLISH_PASSWORD }}
43+
run: sbt +publishSigned
4444

4545
documentation:
4646
# runs on main repo only

build.sbt

+10-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
import com.geirsson.CiReleasePlugin
2+
13
lazy val alpakka = project
24
.in(file("."))
35
.enablePlugins(ScalaUnidocPlugin)
4-
.disablePlugins(MimaPlugin, SitePlugin)
6+
.disablePlugins(MimaPlugin, SitePlugin, CiReleasePlugin)
57
.aggregate(
68
amqp,
79
avroparquet,
@@ -469,7 +471,7 @@ def alpakkaProject(projectId: String, moduleName: String, additionalSettings: sb
469471
import com.typesafe.tools.mima.core._
470472
Project(id = projectId, base = file(projectId))
471473
.enablePlugins(AutomateHeaderPlugin)
472-
.disablePlugins(SitePlugin)
474+
.disablePlugins(SitePlugin, CiReleasePlugin)
473475
.settings(
474476
name := s"akka-stream-alpakka-$projectId",
475477
licenses := {
@@ -498,10 +500,12 @@ def alpakkaProject(projectId: String, moduleName: String, additionalSettings: sb
498500
def internalProject(projectId: String, additionalSettings: sbt.Def.SettingsDefinition*): Project =
499501
Project(id = projectId, base = file(projectId))
500502
.enablePlugins(AutomateHeaderPlugin)
501-
.disablePlugins(SitePlugin, MimaPlugin)
502-
.settings(name := s"akka-stream-alpakka-$projectId",
503-
publish / skip := true,
504-
scalacOptions += "-Wconf:cat=deprecation&msg=.*JavaConverters.*:s")
503+
.disablePlugins(SitePlugin, MimaPlugin, CiReleasePlugin)
504+
.settings(
505+
name := s"akka-stream-alpakka-$projectId",
506+
publish / skip := true,
507+
scalacOptions += "-Wconf:cat=deprecation&msg=.*JavaConverters.*:s"
508+
)
505509
.settings(additionalSettings: _*)
506510

507511
Global / onLoad := (Global / onLoad).value.andThen { s =>

docs/release-train-issue-template.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ Key links:
2525
- [ ] 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".
2626
- [ ] Wait until [main build finished](https://github.com/akka/alpakka/actions) after merging the latest PR
2727
- [ ] 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.
28-
- [ ] 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)
28+
- [ ] 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)
2929

3030
### Check availability
3131

3232
- [ ] Check [API](https://doc.akka.io/api/alpakka/$VERSION$/) documentation
3333
- [ ] 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).
34-
- [ ] Check the release on [Maven central](https://repo1.maven.org/maven2/com/lightbend/akka/akka-stream-alpakka-xml_2.13/$VERSION$/)
34+
- [ ] 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
3535

36-
### When everything is on maven central
36+
### When everything is on https://repo.akka.io/maven
3737
- [ ] Log into `gustav.akka.io` as `akkarepo`
3838
- [ ] If this updates the `current` version, run `./update-alpakka-current-version.sh $VERSION$`
3939
- [ ] otherwise check changes and commit the new version to the local git repository
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Remove deprecated
2+
ProblemFilters.exclude[DirectMissingMethodProblem]("akka.stream.alpakka.elasticsearch.ElasticsearchConnectionSettings.withConnectionContext")
3+
ProblemFilters.exclude[DirectMissingMethodProblem]("akka.stream.alpakka.elasticsearch.ElasticsearchConnectionSettings.withConnectionContext")

elasticsearch/src/main/scala/akka/stream/alpakka/elasticsearch/ElasticsearchConnectionSettings.scala

-26
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@ package akka.stream.alpakka.elasticsearch
77
import akka.http.scaladsl.{ConnectionContext, HttpsConnectionContext}
88
import akka.http.scaladsl.model.HttpHeader
99
import akka.http.scaladsl.model.HttpHeader.ParsingResult
10-
import akka.japi.Util
1110

1211
import scala.collection.JavaConverters._
1312
import javax.net.ssl.SSLContext
14-
import scala.compat.java8.OptionConverters
1513

1614
final class ElasticsearchConnectionSettings private (
1715
val baseUrl: String,
@@ -47,30 +45,6 @@ final class ElasticsearchConnectionSettings private (
4745
copy(headers = scalaHeaders)
4846
}
4947

50-
/** Scala API */
51-
@deprecated("prefer ElasticsearchConnectionSettings.withSSLContext", "3.1.0")
52-
@Deprecated
53-
def withConnectionContext(connectionContext: HttpsConnectionContext): ElasticsearchConnectionSettings =
54-
copy(connectionContext = Option(connectionContext))
55-
56-
/** Java API */
57-
@deprecated("prefer ElasticsearchConnectionSettings.withSSLContext", "3.1.0")
58-
@Deprecated
59-
def withConnectionContext(
60-
connectionContext: akka.http.javadsl.HttpsConnectionContext
61-
): ElasticsearchConnectionSettings = {
62-
val scalaContext = new HttpsConnectionContext(
63-
connectionContext.getSslContext,
64-
None,
65-
OptionConverters.toScala(connectionContext.getEnabledCipherSuites).map(Util.immutableSeq(_)),
66-
OptionConverters.toScala(connectionContext.getEnabledProtocols).map(Util.immutableSeq(_)),
67-
OptionConverters.toScala(connectionContext.getClientAuth),
68-
OptionConverters.toScala(connectionContext.getSslParameters)
69-
)
70-
71-
copy(connectionContext = Option(scalaContext))
72-
}
73-
7448
def withSSLContext(
7549
sslContext: SSLContext
7650
): ElasticsearchConnectionSettings = {

project/Common.scala

+4-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import de.heikoseeberger.sbtheader.HeaderPlugin.autoImport._
77
import com.lightbend.paradox.projectinfo.ParadoxProjectInfoPluginKeys._
88
import com.lightbend.sbt.JavaFormatterPlugin.autoImport.javafmtOnCompile
99
import com.typesafe.tools.mima.plugin.MimaKeys._
10-
import xerial.sbt.Sonatype.autoImport.sonatypeProfileName
10+
import sbtdynver.DynVerPlugin.autoImport.dynverSonatypeSnapshots
1111

1212
object Common extends AutoPlugin {
1313

@@ -123,6 +123,8 @@ object Common extends AutoPlugin {
123123
Seq("-Werror")
124124
case _ => Seq.empty[String]
125125
}),
126+
resolvers += "Akka library repository".at("https://repo.akka.io/maven"),
127+
dynverSonatypeSnapshots := true,
126128
autoAPIMappings := true,
127129
apiURL := Some(url(s"https://doc.akka.io/api/alpakka/${version.value}/akka/stream/alpakka/index.html")),
128130
// show full stack traces and test case durations
@@ -139,7 +141,6 @@ object Common extends AutoPlugin {
139141
javafmtOnCompile := false,
140142
headerLicense := Some(
141143
HeaderLicense.Custom("Copyright (C) since 2016 Lightbend Inc. <https://www.lightbend.com>")
142-
),
143-
sonatypeProfileName := "com.lightbend"
144+
)
144145
)
145146
}

project/Dependencies.scala

+6-7
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@ object Dependencies {
1010
val Scala2Versions = Seq(Scala213)
1111
val ScalaVersions = Dependencies.Scala2Versions :+ Dependencies.Scala3
1212

13-
val AkkaVersion = "2.8.1"
14-
val AkkaBinaryVersion = "2.8"
13+
val AkkaVersion = "2.9.0-M3"
14+
val AkkaBinaryVersion = "2.9"
1515

1616
val InfluxDBJavaVersion = "2.15"
1717

1818
val AwsSdk2Version = "2.17.295"
1919
val AwsSpiAkkaHttpVersion = "1.0.1"
2020
val ProtobufJavaVersion = "3.21.12"
2121
// Sync with plugins.sbt
22-
val AkkaGrpcBinaryVersion = "2.3"
22+
val AkkaGrpcBinaryVersion = "2.4"
2323
// sync ignore prefix in scripts/link-validator.conf#L30
24-
val AkkaHttpVersion = "10.5.1"
25-
val AkkaHttpBinaryVersion = "10.5"
26-
val AlpakkaKafkaVersion = "4.0.2"
24+
val AkkaHttpVersion = "10.6.0-M2"
25+
val AkkaHttpBinaryVersion = "10.6"
26+
val AlpakkaKafkaVersion = "5.0.0-M1"
2727
val ScalaTestVersion = "3.2.15"
2828
val TestContainersScalaTestVersion = "0.40.3" // pulls Testcontainers 1.16.2
2929
val mockitoVersion = "4.8.1" // check even https://github.com/scalatest/scalatestplus-mockito/releases
@@ -234,7 +234,6 @@ object Dependencies {
234234
"org.apache.arrow" % "arrow-vector" % "4.0.0" % "provided",
235235
"io.grpc" % "grpc-auth" % akka.grpc.gen.BuildInfo.grpcVersion, // ApacheV2
236236
"com.typesafe.akka" %% "akka-http-spray-json" % AkkaHttpVersion,
237-
"com.typesafe.akka" %% "akka-http2-support" % AkkaHttpVersion,
238237
"org.apache.arrow" % "arrow-memory-netty" % "4.0.1" % Test,
239238
"com.typesafe.akka" %% "akka-discovery" % AkkaVersion
240239
) ++ Mockito

project/Publish.scala

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/*
2+
* Copyright (C) 2023 Lightbend Inc. <https://www.lightbend.com>
3+
*/
4+
5+
import java.util.concurrent.atomic.AtomicBoolean
6+
7+
import scala.language.postfixOps
8+
9+
import sbt.{Def, _}
10+
import Keys._
11+
import com.geirsson.CiReleasePlugin
12+
import com.jsuereth.sbtpgp.PgpKeys.publishSigned
13+
import xerial.sbt.Sonatype.autoImport.sonatypeProfileName
14+
15+
/**
16+
* For projects that are not published.
17+
*/
18+
object NoPublish extends AutoPlugin {
19+
override def requires = plugins.JvmPlugin
20+
21+
override def projectSettings =
22+
Seq(publish / skip := true, publishArtifact := false, publish := {}, publishLocal := {})
23+
}
24+
25+
object Publish extends AutoPlugin {
26+
override def requires = plugins.JvmPlugin && Common
27+
override def trigger = AllRequirements
28+
29+
lazy val beforePublishTask = taskKey[Unit]("setup before publish")
30+
31+
lazy val beforePublishDone = new AtomicBoolean(false)
32+
33+
def beforePublish(snapshot: Boolean) = {
34+
if (beforePublishDone.compareAndSet(false, true)) {
35+
CiReleasePlugin.setupGpg()
36+
if (!snapshot)
37+
cloudsmithCredentials(validate = true)
38+
}
39+
}
40+
41+
override def projectSettings: Seq[Def.Setting[_]] =
42+
Seq(
43+
sonatypeProfileName := "com.lightbend",
44+
beforePublishTask := beforePublish(isSnapshot.value),
45+
publishSigned := publishSigned.dependsOn(beforePublishTask).value,
46+
publishTo := (if (isSnapshot.value)
47+
Some(Resolver.file("file", target.value / "repository")) // FIXME snapshot repo
48+
else
49+
Some("Cloudsmith API".at("https://maven.cloudsmith.io/lightbend/akka/"))),
50+
credentials ++= (if (isSnapshot.value) Seq[Credentials]() else cloudsmithCredentials(validate = false))
51+
)
52+
53+
def cloudsmithCredentials(validate: Boolean): Seq[Credentials] = {
54+
(sys.env.get("PUBLISH_USER"), sys.env.get("PUBLISH_PASSWORD")) match {
55+
case (Some(user), Some(password)) =>
56+
Seq(Credentials("Cloudsmith API", "maven.cloudsmith.io", user, password))
57+
case _ =>
58+
if (validate)
59+
throw new Exception("Publishing credentials expected in `PUBLISH_USER` and `PUBLISH_PASSWORD`.")
60+
else
61+
Nil
62+
}
63+
}
64+
}

project/plugins.sbt

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
resolvers += "Akka library repository".at("https://repo.akka.io/maven")
2+
13
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.4")
24
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.1.1")
35
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.7")
@@ -14,6 +16,6 @@ addSbtPlugin("com.github.sbt" % "sbt-unidoc" % "0.5.0")
1416
addSbtPlugin("com.thoughtworks.sbt-api-mappings" % "sbt-api-mappings" % "3.0.2")
1517
addSbtPlugin("com.github.sbt" % "sbt-site-paradox" % "1.5.0")
1618
// Akka gRPC -- sync with version in Dependencies.scala:22
17-
addSbtPlugin("com.lightbend.akka.grpc" % "sbt-akka-grpc" % "2.3.1")
19+
addSbtPlugin("com.lightbend.akka.grpc" % "sbt-akka-grpc" % "2.4.0-M1")
1820
// templating
1921
addSbtPlugin("io.spray" % "sbt-boilerplate" % "0.6.1")

0 commit comments

Comments
 (0)