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

Merged
merged 2 commits into from
Nov 6, 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
23 changes: 8 additions & 15 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ permissions:
jobs:
release:
# runs on main repo only
if: github.repository == 'akka/alpakka'
if: github.event.repository.fork == false
name: Release
environment: release
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -43,34 +43,27 @@ jobs:
run: sbt +publishSigned

documentation:
# runs on main repo only
if: github.repository == 'akka/alpakka'
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
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

- 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 +~2.13 docs/publishRsync
sbt publishRsync
env:
AKKA_RSYNC_GUSTAV: ${{ secrets.AKKA_RSYNC_GUSTAV }}
30 changes: 12 additions & 18 deletions docs/src/main/paradox/other-docs/snapshots.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# Snapshots

[snapshots-badge]: https://img.shields.io/nexus/s/com.lightbend.akka/akka-stream-alpakka-csv_2.13?server=https%3A%2F%2Foss.sonatype.org
[snapshots]: https://oss.sonatype.org/content/repositories/snapshots/com/lightbend/akka/akka-stream-alpakka-csv_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 main.
Add the following to your project build definition to resolve Alpakka snapshots:

## Configure repository
Expand All @@ -12,27 +10,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 @@ -41,9 +41,3 @@ Gradle

The [snapshot documentation](https://doc.akka.io/docs/alpakka/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/lightbend/akka/) to see what versions are currently available.
6 changes: 3 additions & 3 deletions docs/src/main/paradox/other-docs/versioning.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ As all Alpakka modules (excluding Alpakka Kafka) share a single version number,

Alpakka publishes

* regular releases to [Maven Central](https://search.maven.org/search?q=g:com.lightbend.akka%20akka-stream-)
* milestone and release candidates (of major versions) to Maven Central
* @ref:[snapshots](snapshots.md) to [Sonatype](https://oss.sonatype.org/content/repositories/snapshots/com/lightbend/akka/)
* regular releases to https://repo.akka.io/maven
* milestone and release candidates (of major versions) to https://repo.akka.io/maven
* @ref:[snapshots](snapshots.md) to https://repo.akka.io/snapshots

### Compatibility

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.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] = {
Expand Down
3 changes: 2 additions & 1 deletion scripts/link-validator.conf
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ site-link-validator {
# MVN repository forbids access after a few requests
"https://mvnrepository.com/artifact/"
# in api/alpakka/snapshot/akka/stream/alpakka/google/scaladsl/X$minusUpload$minusContent$minusType.html
"https://doc.akka.io/api/akka-http/10.5.1/akka/http/impl/"
"https://doc.akka.io/api/akka-http/10.5.1/akka/http/impl/",
"https://repo.akka.io/"
]

non-https-whitelist = [
Expand Down