Skip to content

Commit

Permalink
Publishing to Maven (Take 3) (#2093)
Browse files Browse the repository at this point in the history
  • Loading branch information
ennru authored Apr 18, 2024
1 parent 62e5259 commit 8c4181b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
12 changes: 7 additions & 5 deletions .github/publish-maven.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
#!/usr/bin/env bash

echo "Extracting the SDK version from sbt build"
SDK_VERSION=$(sbt "print coreSdk/version" | tail -n 1)
IS_SNAPSHOT=$(sbt "print coreSdk/isSnapshot" | tail -n 1)
if [ "true" == "${IS_SNAPSHOT}" ]
SDK_VERSION=$(sbt --no-colors "print coreSdk/version" | tail -n 1 | tr -d '\n')
IS_SNAPSHOT=$(sbt --no-colors "print coreSdk/isSnapshot" | tail -n 1 | tr -d '\n')
if [ "false" == "${IS_SNAPSHOT}" ]
then
REPO="akka-repo::default::https://maven.cloudsmith.io/lightbend/akka-snapshots/"
else
REPO="akka-repo::default::https://maven.cloudsmith.io/lightbend/akka/"
else
REPO="akka-repo::default::https://maven.cloudsmith.io/lightbend/akka-snapshots/"
fi
echo "Publishing ${SDK_VERSION} to ${REPO}"

cd maven-java
echo ${PGP_SECRET} | base64 -d | gpg --import --batch
mkdir -p ~/.m2
cat <<EOF >~/.m2/settings.xml
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ permissions:
contents: read

jobs:
release:
if: github.event.repository.fork == false
publish-sbt:
name: Release (sbt)
runs-on: ubuntu-22.04
if: github.event.repository.fork == false
steps:
- name: Checkout
# https://github.com/actions/checkout/releases
Expand Down Expand Up @@ -47,7 +47,7 @@ jobs:
- name: Publish M2
run: sbtn publishM2

release-maven:
publish-maven:
name: Publish maven plugin and archetype
runs-on: ubuntu-22.04
if: github.event.repository.fork == false
Expand All @@ -60,6 +60,11 @@ jobs:
# 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
# https://github.com/coursier/cache-action/releases
# v6.4.5
uses: coursier/cache-action@1ff273bff02a8787bc9f1877d347948af647956d

- name: Set up JDK 17
# https://github.com/coursier/setup-action/releases
# v1.3.5
Expand All @@ -75,7 +80,7 @@ jobs:
PUBLISH_USER: ${{ secrets.PUBLISH_USER }}
PUBLISH_PASSWORD: ${{ secrets.PUBLISH_PASSWORD }}

documentation:
publish-documentation:
name: Documentation
runs-on: ubuntu-22.04
if: github.event.repository.fork == false
Expand Down

0 comments on commit 8c4181b

Please sign in to comment.