Skip to content

Commit

Permalink
build: Publish snapshots (#1870)
Browse files Browse the repository at this point in the history
  • Loading branch information
patriknw authored Nov 3, 2023
1 parent 2372c62 commit 0afb3a5
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 19 deletions.
17 changes: 7 additions & 10 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
sbt:
name: sbt publish
runs-on: ubuntu-22.04
if: github.repository == 'akka/akka-grpc'
if: github.event.repository.fork == false
steps:
- name: Checkout
uses: actions/[email protected]
Expand Down Expand Up @@ -58,17 +58,14 @@ jobs:
documentation:
name: Documentation
runs-on: ubuntu-22.04
if: github.repository == 'akka/akka-grpc'
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:
Expand All @@ -77,9 +74,9 @@ jobs:
- 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 akka-grpc-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 }}
4 changes: 2 additions & 2 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
Akka gRPC 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/grpc).
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 Down
11 changes: 6 additions & 5 deletions project/Publish.scala
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,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
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/lightbend/akka/grpc/"
text: "Snapshots are available from Sonatype"
url: "https://repo.akka.io/snapshots"
text: "Akka library snapshot repository"
}
issues: {
url: "https://github.com/akka/akka-grpc/issues"
Expand Down

0 comments on commit 0afb3a5

Please sign in to comment.