From 57be47c65d6c36d0a9a0a72f13b4f79a1e03b5d7 Mon Sep 17 00:00:00 2001 From: Patrik Nordwall Date: Thu, 2 Nov 2023 12:32:31 +0100 Subject: [PATCH] build: Publish snapshots --- .github/workflows/publish.yml | 21 +++++++++------------ RELEASING.md | 6 +++--- build.sbt | 6 ++---- project/Publish.scala | 11 ++++++----- 4 files changed, 20 insertions(+), 24 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c9ba5658..fd760dc3 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -13,7 +13,7 @@ jobs: sbt: name: sbt publish runs-on: ubuntu-22.04 - if: github.repository == 'akka/akka-persistence-r2dbc' + if: github.event.repository.fork == false steps: - name: Checkout uses: actions/checkout@v3.1.0 @@ -41,7 +41,7 @@ jobs: documentation: name: Documentation runs-on: ubuntu-22.04 - if: github.repository == 'akka/akka-persistence-r2dbc' + if: github.event.repository.fork == false steps: - name: Checkout uses: actions/checkout@v3.1.0 @@ -49,20 +49,17 @@ jobs: # we don't know what commit the last tag was it's safer to get entire repo so previousStableVersion resolves fetch-depth: 0 - - name: Cache Coursier cache - uses: coursier/cache-action@v6.4.0 - - name: Set up JDK 11 uses: coursier/setup-action@v1.3.0 with: - jvm: temurin:1.11.0 + jvm: temurin:1.11 - - name: Publish API and reference documentation + - name: Publish run: |- eval "$(ssh-agent -s)" - echo $SCP_SECRET | base64 -d > /tmp/id_rsa - chmod 600 /tmp/id_rsa - ssh-add /tmp/id_rsa - sbt docs/publishRsync + echo $AKKA_RSYNC_GUSTAV | base64 -d > .github/id_rsa + chmod 600 .github/id_rsa + ssh-add .github/id_rsa + sbt publishRsync env: - SCP_SECRET: ${{ secrets.SCP_SECRET }} + AKKA_RSYNC_GUSTAV: ${{ secrets.AKKA_RSYNC_GUSTAV }} diff --git a/RELEASING.md b/RELEASING.md index 92d2b044..ad918b8b 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -5,8 +5,8 @@ Akka R2DBC is released when there is a need for it. If you want to test an improvement that is not yet released, you can use a -snapshot version: we release all commits to main to the snapshot repository -on [Sonatype](https://oss.sonatype.org/content/repositories/snapshots/com/lightbend/akka/akka-persistence-r2dbc). +snapshot version. We publish snapshot versions for every commit to the `main` branch. +Snapshot builds are available at https://repo.akka.io/snapshots. ## How to release @@ -33,7 +33,7 @@ It is possible to release a revised documentation to the already existing releas ``` 1. If the generated documentation looks good, send it to Gustav: ```sh - sbt dpcs/publishRsync + sbt docs/publishRsync ``` 1. Do not forget to push the new branch back to GitHub. diff --git a/build.sbt b/build.sbt index bfbcbe35..ad80355d 100644 --- a/build.sbt +++ b/build.sbt @@ -25,15 +25,13 @@ inThisBuild( if (isSnapshot.value) None else Some(url(s"https://github.com/akka/akka-persistence-r2dbc/releases/tag/v${version.value}")) ), - licenses := Seq( - ("BUSL-1.1", url("https://raw.githubusercontent.com/akka/akka-persistence-r2dbc/main/LICENSE")) - ), // FIXME change s/main/v1.1.0/ before releasing 1.1.0 + licenses := Seq(("BUSL-1.1", url("https://raw.githubusercontent.com/akka/akka-persistence-r2dbc/main/LICENSE"))), description := "An Akka Persistence backed by SQL database with R2DBC", resolvers += "Akka library repository".at("https://repo.akka.io/maven"), // add snapshot repo when Akka version overriden 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))) def common: Seq[Setting[_]] = diff --git a/project/Publish.scala b/project/Publish.scala index af98bb52..4f4a96fa 100644 --- a/project/Publish.scala +++ b/project/Publish.scala @@ -42,11 +42,12 @@ object Publish extends AutoPlugin { 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))) + 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 {