You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pekko.apache.org by fa...@apache.org on 2023/03/09 00:13:14 UTC

[incubator-pekko-connectors-kafka] branch main updated: use sbt-apache-sonatype (#43)

This is an automated email from the ASF dual-hosted git repository.

fanningpj pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-pekko-connectors-kafka.git


The following commit(s) were added to refs/heads/main by this push:
     new d671774a use sbt-apache-sonatype (#43)
d671774a is described below

commit d671774a849ff5b2290c708a826c788d6a6bce32
Author: PJ Fanning <pj...@users.noreply.github.com>
AuthorDate: Thu Mar 9 01:13:09 2023 +0100

    use sbt-apache-sonatype (#43)
    
    * use sbt-apache-sonatype
    
    * Update build.sbt
---
 .github/release-drafter.yml            | 20 ---------
 .github/workflows/release-drafter.yml  | 17 --------
 .github/workflows/release.yml          | 63 -----------------------------
 RELEASING.md                           | 28 -------------
 build.sbt                              | 19 ++-------
 docs/release-train-issue-template.md   | 74 ----------------------------------
 project/MetaInfLicenseNoticeCopy.scala | 31 --------------
 project/ProjectSettings.scala          | 15 +++----
 project/plugins.sbt                    |  2 +-
 scripts/create-release-issue.sh        | 10 -----
 10 files changed, 13 insertions(+), 266 deletions(-)

diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml
deleted file mode 100644
index 35b6a0ed..00000000
--- a/.github/release-drafter.yml
+++ /dev/null
@@ -1,20 +0,0 @@
-# Config for https://github.com/toolmantim/release-drafter
-name-template: 'Alpakka Kafka $NEXT_PATCH_VERSION'
-tag-template: 'v$NEXT_PATCH_VERSION'
-categories:
-  - title: 'Benchmarks'
-    label: 'benchmarks'
-  - title: 'Alpakka Kafka core'
-    label: 'core'
-  - title: 'Tests'
-    label: 'tests'
-  - title: 'Alpakka Kafka Testkit'
-    label: 'testkit'
-  - title: 'Documentation'
-    label: 'documentation'
-
-change-template: '- $TITLE [#$NUMBER](https://github.com/akka/alpakka-kafka/issues/$NUMBER) by [@$AUTHOR](https://github.com/$AUTHOR)'
-template: |
-  ## Changes
-
-  $CHANGES
diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml
deleted file mode 100644
index 2f4118dc..00000000
--- a/.github/workflows/release-drafter.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-name: Release Drafter
-
-on:
-  push:
-    branches:
-    - master
-    - main
-    - release-*
-
-jobs:
-  update_release_draft:
-    runs-on: ubuntu-latest
-    steps:
-      # Drafts your next Release notes as Pull Requests are merged
-      - uses: release-drafter/release-drafter@v5
-        env:
-          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
deleted file mode 100644
index 37d0bc80..00000000
--- a/.github/workflows/release.yml
+++ /dev/null
@@ -1,63 +0,0 @@
-name: Release
-
-on:
-  push:
-    branches:
-      - master
-      - main
-      - release-*
-    tags: ["*"]
-  release:
-    types: [published]
-
-jobs:
-  release:
-    # runs on main repo only
-    if: github.repository == 'apache/incubator-pekko-connectors-kafka'
-    name: Release
-    # the release environment provides access to secrets required in the release process
-    # https://github.com/akka/alpakka-kafka/settings/environments/84275678/edit
-    environment: release
-    runs-on: ubuntu-22.04
-    steps:
-      - name: Checkout
-        uses: actions/checkout@v3
-        with:
-          # we don't know what commit the last tag was it's safer to get entire repo so previousStableVersion resolves
-          fetch-depth: 0
-
-      - name: Checkout GitHub merge
-        if: github.event.pull_request
-        run: |-
-          git fetch origin pull/${{ github.event.pull_request.number }}/merge:scratch
-          git checkout scratch
-
-      - name: Setup Java 8
-        uses: actions/setup-java@v3
-        with:
-          distribution: temurin
-          java-version: 8
-
-      - name: Cache Coursier cache
-        uses: coursier/cache-action@v6
-
-#      - name: License checks
-
-# TODO: Separate snapshots and milestone releases (apache nightlies, sonatype)
-#      - name: Publish artifacts for all Scala versions
-#        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
-#
-#      - name: Publish API and reference documentation
-#        env:
-#          GUSTAV_KEY: ${{ secrets.GUSTAV_KEY }}
-#        run: |+
-#          eval "$(ssh-agent -s)"
-#          echo $GUSTAV_KEY | base64 -di > .github/id_rsa
-#          chmod 600 .github/id_rsa
-#          ssh-add .github/id_rsa
-#          sbt "++2.13.8 docs/publishRsync"
diff --git a/RELEASING.md b/RELEASING.md
deleted file mode 100644
index 28066607..00000000
--- a/RELEASING.md
+++ /dev/null
@@ -1,28 +0,0 @@
-# Releasing
-
-Create a new issue from the [Apache Pekko Kafka Connector Release Train Issue Template](docs/release-train-issue-template.md) and follow the steps.
-
-```bash
-~/pekko-connectors-kafka> scripts/create-release-issue.sh `version-to-be-released`
-```
-
-### Releasing only updated docs
-
-It is possible to release a revised documentation to the already existing release.
-
-1. Create a new branch from a release tag. If a revised documentation is for the `v1.1.1` release, then the name of the new branch should be `docs/v1.1.1`.
-1. Add and commit `version.sbt` file that pins the version to the one, that is being revised. Also set `isSnapshot` to `false` for the stable documentation links. For example:
-    ```scala
-    ThisBuild / version := "1.1.1"
-    ThisBuild / isSnapshot := false
-    ```
-1. Make all of the required changes to the documentation.
-1. Check the documentation update locally:
-    ```sh
-    sbt docs/previewSite
-    ```
-1. If the generated documentation looks good, send it to Gustav:
-    ```sh
-    sbt docs/publishRsync
-    ```
-1. Do not forget to push the new branch back to GitHub.
diff --git a/build.sbt b/build.sbt
index a6a81356..0f937ce3 100644
--- a/build.sbt
+++ b/build.sbt
@@ -1,10 +1,10 @@
 import com.typesafe.tools.mima.core.{ Problem, ProblemFilters }
 import ProjectSettings.commonSettings
 
-enablePlugins(AutomateHeaderPlugin)
-
 ThisBuild / resolvers ++= ResolverSettings.projectResolvers
 
+ThisBuild / apacheSonatypeProjectProfile := "pekko"
+
 TaskKey[Unit]("verifyCodeFmt") := {
   javafmtCheckAll.all(ScopeFilter(inAnyProject)).result.value.toEither.left.foreach { _ =>
     throw new MessageOnlyException(
@@ -27,11 +27,9 @@ lazy val `pekko-connectors-kafka` =
     .aggregate(core, testkit, `cluster-sharding`, tests, benchmarks, docs)
 
 lazy val core = project
-  .enablePlugins(AutomateHeaderPlugin)
   .disablePlugins(SitePlugin)
   .settings(commonSettings)
   .settings(VersionGenerator.settings)
-  .settings(MetaInfLicenseNoticeCopy.settings)
   .settings(
     name := "pekko-connectors-kafka",
     AutomaticModuleName.settings("org.apache.pekko.kafka"),
@@ -41,10 +39,8 @@ lazy val core = project
 
 lazy val testkit = project
   .dependsOn(core)
-  .enablePlugins(AutomateHeaderPlugin)
   .disablePlugins(SitePlugin)
   .settings(commonSettings)
-  .settings(MetaInfLicenseNoticeCopy.settings)
   .settings(
     name := "pekko-connectors-kafka-testkit",
     AutomaticModuleName.settings("org.apache.pekko.kafka.testkit"),
@@ -58,10 +54,8 @@ lazy val testkit = project
 lazy val `cluster-sharding` = project
   .in(file("./cluster-sharding"))
   .dependsOn(core)
-  .enablePlugins(AutomateHeaderPlugin)
   .disablePlugins(SitePlugin)
   .settings(commonSettings)
-  .settings(MetaInfLicenseNoticeCopy.settings)
   .settings(
     name := "pekko-connectors-kafka-cluster-sharding",
     AutomaticModuleName.settings("org.apache.pekko.kafka.cluster.sharding"),
@@ -71,7 +65,6 @@ lazy val `cluster-sharding` = project
 
 lazy val tests = project
   .dependsOn(core, testkit, `cluster-sharding`)
-  .enablePlugins(AutomateHeaderPlugin)
   .disablePlugins(MimaPlugin, SitePlugin)
   .configs(IntegrationTest.extend(Test))
   .settings(commonSettings)
@@ -90,7 +83,7 @@ lazy val tests = project
     IntegrationTest / parallelExecution := false)
 
 lazy val docs = project
-  .enablePlugins(ParadoxPlugin, PekkoParadoxPlugin, ParadoxSitePlugin, PreprocessPlugin, PublishRsyncPlugin)
+  .enablePlugins(ParadoxPlugin, PekkoParadoxPlugin, ParadoxSitePlugin, PreprocessPlugin)
   .disablePlugins(MimaPlugin)
   .settings(commonSettings)
   .settings(
@@ -112,17 +105,13 @@ lazy val docs = project
         _ => "https://docs\\.oracle\\.com/en/java/javase/11/docs/api/")),
     Paradox / siteSubdirName := s"docs/pekko-connectors-kafka/${projectInfoVersion.value}",
     ParadoxSettings.settings,
-    resolvers += Resolver.jcenterRepo,
-    publishRsyncArtifacts += makeSite.value -> "www/",
-    publishRsyncHost := "akkarepo@gustav.akka.io")
+    resolvers += Resolver.jcenterRepo)
 
 lazy val benchmarks = project
   .dependsOn(core, testkit)
-  .enablePlugins(AutomateHeaderPlugin)
   .disablePlugins(MimaPlugin, SitePlugin)
   .configs(IntegrationTest)
   .settings(commonSettings)
-  .settings(MetaInfLicenseNoticeCopy.settings)
   .settings(Defaults.itSettings)
   .settings(headerSettings(IntegrationTest))
   .settings(
diff --git a/docs/release-train-issue-template.md b/docs/release-train-issue-template.md
deleted file mode 100644
index d3f7588b..00000000
--- a/docs/release-train-issue-template.md
+++ /dev/null
@@ -1,74 +0,0 @@
-Release Alpakka Kafka $VERSION$
-
-<!--
-# Release Train Issue Template for Alpakka Kafka
-
-(Liberally copied and adopted from Scala itself https://github.com/scala/scala-dev/blob/b11cd2e4a4431de7867db6b39362bea8fa6650e7/notes/releases/template.md)
-
-For every Alpakka Kafka release, make a copy of this file named after the release, and expand the variables.
-Ideally replacing variables could become a script you can run on your local machine.
-
-Variables to be expanded in this template:
-- $VERSION$=???
-
-Key links:
-  - akka/alpakka-kafka milestone: https://github.com/akka/alpakka-kafka/milestone/?
--->
-### ~ 1 week before the release
-
-- [ ] Check that any new `deprecated` annotations use the correct version name
-- [ ] Check that open PRs and issues assigned to the milestone are reasonable
-- [ ] Decide on a planned release date
-- [ ] Create a new milestone for the [next version](https://github.com/akka/alpakka-kafka/milestones)
-- [ ] Check [closed issues without a milestone](https://github.com/akka/alpakka-kafka/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aclosed%20no%3Amilestone) and either assign them the 'upcoming' release milestone or `invalid/not release-bound`
-
-### 1 day before the release
-
-- [ ] Make sure all important / big PRs have been merged by now
-- [ ] Check versions listed in [home.md](https://github.com/akka/alpakka-kafka/blob/master/docs/src/main/paradox/home.md)
-
-### Preparing release notes in the documentation / announcement
-
-- [ ] Review the [draft release notes](https://github.com/akka/alpakka-kafka/releases)
-- [ ] For non-patch releases: Create a news item draft PR on [akka.github.com](https://github.com/akka/akka.github.com), using the milestone
-- [ ] Move all [unclosed issues](https://github.com/akka/alpakka-kafka/issues?q=is%3Aopen+is%3Aissue+milestone%3A$VERSION$) for this milestone to the next milestone
-- [ ] Close the [$VERSION$ milestone](https://github.com/akka/alpakka-kafka/milestones?direction=asc&sort=due_date)
-
-### Cutting the release
-
-- [ ] Wait until [master build finished](https://github.com/akka/alpakka-kafka/actions?query=branch%3Amaster)
-- [ ] Update the [draft release](https://github.com/akka/alpakka-kafka/releases) with the next tag version `v$VERSION$`, title and release description linking to the announcement, release notes and milestone
-- [ ] Check that GitHub Actions release build has executed successfully (GitHub Actions will start a [CI build](https://github.com/akka/alpakka-kafka/actions) for the new tag and publish artifacts to Sonatype)
-
-### Check availability
-- [ ] Check [API](https://doc.akka.io/api/alpakka-kafka/$VERSION$/) documentation
-- [ ] Check [reference](https://pekko.apache.org/docs/pekko-connectors-kafka-kafka/$VERSION$/) documentation
-- [ ] Check the release on [Maven central](https://repo1.maven.org/maven2/com/typesafe/akka/akka-stream-kafka_2.13/$VERSION$/)
-
-### When everything is on maven central
-- [ ] Log into `gustav.akka.io` as `akkarepo`
-  - [ ] update the `current` links on `repo.akka.io` to point to the latest version with
-     ```
-     ln -nsf $VERSION$ www/docs/alpakka-kafka/current
-     ln -nsf $VERSION$ www/api/alpakka-kafka/current
-     ln -nsf $VERSION$ www/docs/alpakka-kafka/3.0
-     ln -nsf $VERSION$ www/api/alpakka-kafka/3.0
-     ```
-  - [ ] check changes and commit the new version to the local git repository
-     ```
-     cd ~/www
-     git add docs/alpakka-kafka/
-     git add api/alpakka-kafka/
-     git commit -m "Alpakka Kafka $VERSION$"
-     ```
-     
-### Announcements
-- [ ] For non-patch releases: Merge draft news item for [akka.io](https://github.com/akka/akka.github.com)
-- [ ] Send a release notification to [Lightbend discuss](https://discuss.akka.io)
-- [ ] Tweet using the akkateam account (or ask someone to) about the new release
-- [ ] Announce internally
-
-### Afterwards
-- [ ] Update Alpakka Kafka dependency in Alpakka main repository
-- [ ] Update version for [Lightbend Supported Modules](https://developer.lightbend.com/docs/lightbend-platform/introduction/getting-help/build-dependencies.html#_alpakka_kafka) in [private project](https://github.com/lightbend/lightbend-platform-docs/blob/master/docs/modules/getting-help/examples/build.sbt)
-- Close this issue
diff --git a/project/MetaInfLicenseNoticeCopy.scala b/project/MetaInfLicenseNoticeCopy.scala
deleted file mode 100644
index 1f185755..00000000
--- a/project/MetaInfLicenseNoticeCopy.scala
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * license agreements; and to You under the Apache License, version 2.0:
- *
- *   https://www.apache.org/licenses/LICENSE-2.0
- *
- * This file is part of the Apache Pekko project, which was derived from Akka.
- */
-
-import sbt.Keys._
-import sbt._
-
-/**
- * Copies LICENSE and NOTICE files into jar META-INF dir
- */
-object MetaInfLicenseNoticeCopy {
-
-  val settings: Seq[Setting[_]] = inConfig(Compile)(
-    Seq(
-      resourceGenerators += copyFileToMetaInf(resourceManaged, "LICENSE"),
-      resourceGenerators += copyFileToMetaInf(resourceManaged, "NOTICE"),
-      resourceGenerators += copyFileToMetaInf(resourceManaged, "DISCLAIMER")))
-
-  def copyFileToMetaInf(dir: SettingKey[File], fileName: String) = Def.task[Seq[File]] {
-    val fromFile = (LocalRootProject / baseDirectory).value / fileName
-    val toFile = resourceManaged.value / "META-INF" / fileName
-    IO.copyFile(fromFile, toFile)
-    Seq(toFile)
-  }
-
-}
diff --git a/project/ProjectSettings.scala b/project/ProjectSettings.scala
index 70b04b33..2363ed55 100644
--- a/project/ProjectSettings.scala
+++ b/project/ProjectSettings.scala
@@ -15,9 +15,14 @@ import net.aichler.jupiter.sbt.Import.jupiterTestFramework
 import org.scalafmt.sbt.ScalafmtPlugin.autoImport.scalafmtOnCompile
 import sbt.{ Def, _ }
 import sbt.Keys._
-import xerial.sbt.Sonatype.autoImport.{ sonatypeCredentialHost, sonatypeProfileName }
+import xerial.sbt.Sonatype.autoImport.sonatypeCredentialHost
+import org.mdedetrich.apache.sonatype.SonatypeApachePlugin
+import SonatypeApachePlugin.autoImport.apacheSonatypeDisclaimerFile
+
+object ProjectSettings extends AutoPlugin {
+
+  override val requires = SonatypeApachePlugin
 
-object ProjectSettings {
   val onLoadMessage: String = """
     |** Welcome to the Apache Pekko Kafka Connector! **
     |
@@ -59,9 +64,6 @@ object ProjectSettings {
   private val apacheBaseRepo = "repository.apache.org"
 
   lazy val commonSettings: Seq[Def.Setting[_]] = Def.settings(
-    organization := "org.apache.pekko",
-    organizationName := "Apache Software Foundation",
-    organizationHomepage := Some(url("https://www.apache.org")),
     homepage := Some(url("https://pekko.apache.org/docs/pekko-connectors-kafka/current/")),
     scmInfo := Some(ScmInfo(url("https://github.com/apache/incubator-pekko-connectors-kafka"),
       "git@github.com:apache/incubator-pekko-connectors-kafka.git")),
@@ -71,7 +73,6 @@ object ProjectSettings {
       "dev@pekko.apache.org",
       url("https://github.com/apache/incubator-pekko-connectors-kafka/graphs/contributors")),
     startYear := Some(2022),
-    licenses := Seq("Apache-2.0" -> url("https://opensource.org/licenses/Apache-2.0")),
     description := "Apache Pekko Kafka Connector is a Reactive Enterprise Integration library for Java and Scala, based on Reactive Streams and Apache Pekko.",
     crossScalaVersions := Seq(Scala213),
     scalaVersion := Scala213,
@@ -119,7 +120,7 @@ object ProjectSettings {
     pomIncludeRepository := (_ => false),
     credentials ++= apacheNexusCredentials,
     sonatypeCredentialHost := apacheBaseRepo,
-    sonatypeProfileName := "org.apache.pekko")
+    apacheSonatypeDisclaimerFile := Some((LocalRootProject / baseDirectory).value / "DISCLAIMER"))
 
   private def apacheNexusCredentials: Seq[Credentials] =
     (sys.env.get("NEXUS_USER"), sys.env.get("NEXUS_PW")) match {
diff --git a/project/plugins.sbt b/project/plugins.sbt
index b1ddc625..c93a962c 100644
--- a/project/plugins.sbt
+++ b/project/plugins.sbt
@@ -1,13 +1,13 @@
 addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.1.1")
 addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.10")
 addSbtPlugin("net.aichler" % "sbt-jupiter-interface" % "0.9.1")
+addSbtPlugin("org.mdedetrich" % "sbt-apache-sonatype" % "0.1.5")
 // discipline
 addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.7.0")
 addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6")
 addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.0")
 addSbtPlugin("com.lightbend.sbt" % "sbt-java-formatter" % "0.7.0")
 // docs
-addSbtPlugin("com.lightbend.sbt" % "sbt-publish-rsync" % "0.2")
 addSbtPlugin("com.github.sbt" % "sbt-unidoc" % "0.5.0")
 // Java 11 module names are not added https://github.com/ThoughtWorksInc/sbt-api-mappings/issues/58
 addSbtPlugin("com.thoughtworks.sbt-api-mappings" % "sbt-api-mappings" % "3.0.2")
diff --git a/scripts/create-release-issue.sh b/scripts/create-release-issue.sh
deleted file mode 100755
index 6a868962..00000000
--- a/scripts/create-release-issue.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash
-
-VERSION=$1
-if [ -z $VERSION ]
-then
-  echo specify the version name to be released, eg. 2.2.0
-else
-  sed -e 's/\$VERSION\$/'$VERSION'/g' docs/release-train-issue-template.md > /tmp/release-$VERSION.md
-  echo Created $(gh issue create --title 'Release Alpakka Kafka' --body-file /tmp/release-$VERSION.md --milestone $VERSION --web)
-fi


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pekko.apache.org
For additional commands, e-mail: commits-help@pekko.apache.org