From 76567730efefb0fecc8c9caa8bc215b80a5a7727 Mon Sep 17 00:00:00 2001 From: Patrik Nordwall Date: Fri, 3 Nov 2023 11:22:12 +0100 Subject: [PATCH] build: Publish snapshots (#1070) --- .github/workflows/publish.yml | 34 +++++++++++----------------------- README.md | 2 +- build.sbt | 2 +- project/Publish.scala | 11 ++++++----- project/link-validator.conf | 3 ++- project/project-info.conf | 4 ++-- testLatestAkkaSnapshot.sh | 5 ----- 7 files changed, 23 insertions(+), 38 deletions(-) delete mode 100755 testLatestAkkaSnapshot.sh diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 39e3ab56..29081c2b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -47,40 +47,28 @@ jobs: run: sbt +publishSigned documentation: - # runs on main repo only - if: github.event.repository.fork == false name: Documentation - environment: release runs-on: ubuntu-22.04 - env: - JAVA_OPTS: -Xms2G -Xmx2G -Xss2M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8 + if: github.event.repository.fork == false steps: - name: Checkout - # https://github.com/actions/checkout/releases - # v3.3.0 - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c + uses: actions/checkout@v3.1.0 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: Setup JDK 11 - # https://github.com/coursier/setup-action/releases - # v1.3.0 - uses: coursier/setup-action@70323223454ac2a9eb2de46f389b4d045cbcdea5 + - name: Set up JDK 11 + uses: coursier/setup-action@v1.3.0 with: jvm: temurin:1.11 - - name: Cache Coursier cache - # https://github.com/coursier/cache-action/releases/ - # v6.4.3 - uses: coursier/cache-action@d1039466d0812d6370649b9afb02bbf5f646bacf - - - name: Publish API and reference documentation - env: - GUSTAV_KEY: ${{ secrets.GUSTAV_KEY }} - run: |+ + - name: Publish + run: |- eval "$(ssh-agent -s)" - echo $GUSTAV_KEY | base64 -di > .github/id_rsa + echo $AKKA_RSYNC_GUSTAV | base64 -d > .github/id_rsa chmod 600 .github/id_rsa ssh-add .github/id_rsa - sbt docs/publishRsync + sbt publishRsync + env: + AKKA_RSYNC_GUSTAV: ${{ secrets.AKKA_RSYNC_GUSTAV }} + diff --git a/README.md b/README.md index 9553b7b9..8bd9cfe7 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ For questions please use the [discuss.akka.io](https://discuss.lightbend.com/c/a The current version's documentation is available at https://doc.akka.io/docs/akka-persistence-cassandra/current/. -[Snapshot documentation](https://doc.akka.io/docs/akka-persistence-cassandra/snapshot/) and [snapshot artifacts](https://oss.sonatype.org/content/repositories/snapshots/com/typesafe/akka/akka-persistence-cassandra_2.13/) are published for every successful `main` branch build. +[Snapshot documentation](https://doc.akka.io/docs/akka-persistence-cassandra/snapshot/) and snapshot artifacts at https://repo.akka.io/snapshots are published for every successful `main` branch build. For versions earlier than 1.0.0, check this README.md file for the corresponding release tag. diff --git a/build.sbt b/build.sbt index 9435098b..e6b5ea4e 100644 --- a/build.sbt +++ b/build.sbt @@ -4,7 +4,7 @@ import com.geirsson.CiReleasePlugin ThisBuild / resolvers += "Akka library repository".at("https://repo.akka.io/maven") ThisBuild / resolvers ++= { if (System.getProperty("override.akka.version") != null) - Seq("Akka Snapshots".at("https://oss.sonatype.org/content/repositories/snapshots/")) + Seq("Akka library snapshot repository".at("https://repo.akka.io/snapshots")) else Seq.empty } diff --git a/project/Publish.scala b/project/Publish.scala index 1813de35..0bdc77c6 100644 --- a/project/Publish.scala +++ b/project/Publish.scala @@ -43,11 +43,12 @@ object Publish extends AutoPlugin { sonatypeProfileName := "com.typesafe", 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))) + publishTo := + (if (isSnapshot.value) + Some("Cloudsmith API".at("https://maven.cloudsmith.io/lightbend/akka-snapshots/")) + else + Some("Cloudsmith API".at("https://maven.cloudsmith.io/lightbend/akka/"))), + credentials ++= cloudsmithCredentials(validate = false)) def cloudsmithCredentials(validate: Boolean): Seq[Credentials] = { (sys.env.get("PUBLISH_USER"), sys.env.get("PUBLISH_PASSWORD")) match { diff --git a/project/link-validator.conf b/project/link-validator.conf index beeb55c7..7d5c0641 100644 --- a/project/link-validator.conf +++ b/project/link-validator.conf @@ -18,7 +18,8 @@ site-link-validator { ignore-prefixes = [ # GitHub will block with "429 Too Many Requests" - "https://github.com/" + "https://github.com/", + "https://repo.akka.io/" ] non-https-whitelist = [ diff --git a/project/project-info.conf b/project/project-info.conf index a664722c..80d8f2a7 100644 --- a/project/project-info.conf +++ b/project/project-info.conf @@ -3,8 +3,8 @@ project-info { shared-info { jdk-versions: ["Eclipse Temurin JDK 11", "Eclipse Temurin JDK 17"] snapshots: { - url: "https://oss.sonatype.org/content/repositories/snapshots/com/typesafe/akka/akka-persistence-cassandra_2.13/" - text: "Snapshots are available from Sonatype" + url: "https://repo.akka.io/snapshots" + text: "Akka library snapshot repository" } issues: { url: "https://github.com/akka/akka-persistence-cassandra/issues" diff --git a/testLatestAkkaSnapshot.sh b/testLatestAkkaSnapshot.sh deleted file mode 100755 index 6776321a..00000000 --- a/testLatestAkkaSnapshot.sh +++ /dev/null @@ -1,5 +0,0 @@ -VERSION=$(curl https://oss.sonatype.org/content/repositories/snapshots/com/typesafe/akka/akka-actor_2.13/ | grep -o '2.6\.[0-9]*+[0-9]*-[0-9a-z]*-SNAPSHOT' | sort -V | tail -n 1) - -echo "Running with version Akka $VERSION" - -sbt -Doverride.akka.version=$VERSION "++2.13.6; test"