Skip to content

Commit

Permalink
build: Publish snapshots (#1070)
Browse files Browse the repository at this point in the history
  • Loading branch information
patriknw authored Nov 3, 2023
1 parent 263d838 commit 7656773
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 38 deletions.
34 changes: 11 additions & 23 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[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: 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/[email protected]
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 }}

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
11 changes: 6 additions & 5 deletions project/Publish.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion project/link-validator.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
4 changes: 2 additions & 2 deletions project/project-info.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 0 additions & 5 deletions testLatestAkkaSnapshot.sh

This file was deleted.

0 comments on commit 7656773

Please sign in to comment.