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 #1689

Merged
merged 2 commits into from
Nov 8, 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
27 changes: 7 additions & 20 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,40 +49,27 @@ jobs:
run: sbt +publishSigned

documentation:
# runs on main repo only
if: github.event.repository.fork == false
name: Documentation
# the release environment provides access to secrets required in the release process
# https://github.com/akka/alpakka-kafka/settings/environments/84275678/edit
environment: release
runs-on: ubuntu-22.04
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: 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/[email protected]

- name: Set up JDK 17
uses: coursier/[email protected]
with:
jvm: temurin:1.17.0.5

- 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 }}
32 changes: 13 additions & 19 deletions docs/src/main/paradox/snapshots.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
---
project.description: Snapshot builds of Alpakka Kafka are provided via the Sonatype snapshot repository.
project.description: Snapshot builds of Alpakka Kafka.
---
# Snapshots

[snapshots-badge]: https://img.shields.io/nexus/s/com.typesafe.akka/akka-stream-kafka_2.13?server=https%3A%2F%2Foss.sonatype.org
[snapshots]: https://oss.sonatype.org/content/repositories/snapshots/com/typesafe/akka/akka-stream-kafka_2.13/

Snapshots are published to the Sonatype Snapshot repository after every successful build on main.
Snapshots are published to https://repo.akka.io/snapshots repository after every successful build on main.
Add the following to your project build definition to resolve Alpakka Kafka connector snapshots:

## Configure repository
Expand All @@ -15,27 +12,29 @@ Maven
: ```xml
<project>
...
<repositories>
<repository>
<id>snapshots-repo</id>
<name>Sonatype snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>
</repositories>
<repositories>
<repositories>
<repository>
<id>akka-repository</id>
<name>Akka library snapshot repository</name>
<url>https://repo.akka.io/snapshots</url>
</repository>
</repositories>
</repositories>
...
</project>
```

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"
}
}
```
Expand All @@ -44,8 +43,3 @@ Gradle

The [snapshot documentation](https://doc.akka.io/docs/alpakka-kafka/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 Alpakka Kafka files](https://oss.sonatype.org/content/repositories/snapshots/com/typesafe/akka/akka-stream-kafka_2.13/) to see what versions are currently available.
22 changes: 12 additions & 10 deletions project/Publish.scala
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,18 @@ object Publish extends AutoPlugin {
}
}

override def projectSettings: Seq[Def.Setting[_]] = Seq(
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))
)
override def projectSettings: Seq[Def.Setting[_]] =
Seq(
sonatypeProfileName := "com.typesafe",
beforePublishTask := beforePublish(isSnapshot.value),
publishSigned := publishSigned.dependsOn(beforePublishTask).value,
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 scripts/link-validator.conf
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ site-link-validator {
# gives: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure requests
"https://javadoc.io/static/",
# The address is hit too often and blocked
"https://opensource.org/licenses/Apache-2.0"
"https://opensource.org/licenses/Apache-2.0",
"https://repo.akka.io/"
]

non-https-whitelist = [
Expand Down