Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Publish snapshots #477

Merged
merged 1 commit into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 9 additions & 12 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
Expand Down Expand Up @@ -41,28 +41,25 @@ 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/[email protected]
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: Cache Coursier cache
uses: coursier/[email protected]

- name: Set up JDK 11
uses: coursier/[email protected]
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 }}
6 changes: 3 additions & 3 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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.

6 changes: 2 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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[_]] =
Expand Down
11 changes: 6 additions & 5 deletions project/Publish.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down