From f741de4bc92f868525f780a4a66ec168afa48b0d Mon Sep 17 00:00:00 2001 From: Patrik Nordwall Date: Thu, 2 Nov 2023 14:22:23 +0100 Subject: [PATCH] build: Publish snapshots --- .github/workflows/release.yml | 33 ++++++++---------------------- docs/src/main/paradox/snapshots.md | 32 ++++++++++++----------------- project/Publish.scala | 11 +++++----- 3 files changed, 28 insertions(+), 48 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 37e9953c2..20b0c4487 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,7 +13,7 @@ permissions: jobs: release: # runs on main repo only - if: github.repository == 'akka/akka-persistence-jdbc' + if: github.event.repository.fork == false name: Release # the release environment provides access to secrets required in the release process # https://github.com/akka/akka-persistence-jdbc/settings/environments/164872635/edit @@ -48,13 +48,9 @@ jobs: run: sbt +publishSigned documentation: - # runs on main repo only - if: github.repository == 'akka/akka-persistence-jdbc' name: Documentation - # the release environment provides access to secrets required in the release process - # https://github.com/akka/akka-persistence-jdbc/settings/environments/164872635/edit - environment: release runs-on: ubuntu-22.04 + if: github.event.repository.fork == false steps: - name: Checkout uses: actions/checkout@v3.1.0 @@ -62,28 +58,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: Checkout GitHub merge - if: github.event.pull_request - run: |- - git fetch origin pull/${{ github.event.pull_request.number }}/merge:scratch - git checkout scratch - - - 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 - env: - GUSTAV_KEY: ${{ secrets.GUSTAV_KEY }} - GUSTAV_PASSPHRASE: ${{ secrets.GUSTAV_PASSPHRASE }} - 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-keygen -p -P "$GUSTAV_PASSPHRASE" -N "" -f .github/id_rsa ssh-add .github/id_rsa - sbt "docs/publishRsync" + sbt publishRsync + env: + AKKA_RSYNC_GUSTAV: ${{ secrets.AKKA_RSYNC_GUSTAV }} diff --git a/docs/src/main/paradox/snapshots.md b/docs/src/main/paradox/snapshots.md index 0c1c042ec..c10102c2f 100644 --- a/docs/src/main/paradox/snapshots.md +++ b/docs/src/main/paradox/snapshots.md @@ -1,12 +1,9 @@ --- -project.description: Snapshot builds of Akka Projection are provided via the Sonatype snapshot repository. +project.description: Snapshot builds via the Sonatype snapshot repository. --- # Snapshots -[snapshots-badge]: https://img.shields.io/nexus/s/com.lightbend.akka/akka-persistence-jdbc_2.13?server=https%3A%2F%2Foss.sonatype.org -[snapshots]: https://oss.sonatype.org/content/repositories/snapshots/com/lightbend/akka/akka-persistence-jdbc_2.13/ - -Snapshots are published to the Sonatype Snapshot repository after every successful build on master. +Snapshots are published to https://repo.akka.io/snapshots repository after every successful build on master. Add the following to your project build definition to resolve Akka Persistence JDBC's snapshots: ## Configure repository @@ -15,27 +12,29 @@ Maven : ```xml ... - - - snapshots-repo - Sonatype snapshots - https://oss.sonatype.org/content/repositories/snapshots - - + + + + akka-repository + Akka library snapshot repository + https://repo.akka.io/snapshots + + + ... ``` sbt : ```scala - resolvers += Resolver.sonatypeRepo("snapshots") + resolvers += "Akka library snapshot repository".at("https://repo.akka.io/snapshots") ``` Gradle : ```gradle repositories { maven { - url "https://oss.sonatype.org/content/repositories/snapshots" + url "https://repo.akka.io/snapshots" } } ``` @@ -44,8 +43,3 @@ Gradle The [snapshot documentation](https://doc.akka.io/docs/akka-persistence-jdbc/snapshot) is updated with every snapshot build. -## Versions - -Latest published snapshot version is [![snapshots-badge][]][snapshots] - -The snapshot repository is cleaned from time to time with no further notice. Check [Sonatype snapshots Akka Projection files](https://oss.sonatype.org/content/repositories/snapshots/com/lightbend/akka/akka-persistence-jdbc_2.13/) to see what versions are currently available. diff --git a/project/Publish.scala b/project/Publish.scala index b2bca2586..ce1d91a6e 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 {