Skip to content

Commit

Permalink
Add publish step
Browse files Browse the repository at this point in the history
  • Loading branch information
nktpro committed Dec 7, 2021
1 parent 86bdce7 commit a6a8c5d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,13 @@ jobs:

- name: Test
run: sbt --client test

- name: Publish
env:
PGP_SIGNING_KEY: ${{ secrets.PGP_SIGNING_KEY }}
PGP_SIGNING_KEY_FP: ${{ secrets.PGP_SIGNING_KEY_FP }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
run: |
printenv PGP_SIGNING_KEY | base64 -d | gpg --import
./release.sh publish
6 changes: 3 additions & 3 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,18 @@ get_release_version() {
fi
}

release() {
publish() {
local SONATYPE_USERNAME=${SONATYPE_USERNAME:?"SONATYPE_USERNAME is required"}
local SONATYPE_PASSWORD=${SONATYPE_PASSWORD:?"SONATYPE_PASSWORD is required"}
local PGP_SIGNING_KEY=${PGP_SIGNING_KEY:?"PGP_SIGNING_KEY is required"}
local PGP_SIGNING_KEY_FP=${PGP_SIGNING_KEY_FP:?"PGP_SIGNING_KEY_FP is required"}
local RELEASE_VERSION
RELEASE_VERSION=$("$0" get_release_version) || exit $?

sbt --client "set ThisBuild / version := \"${RELEASE_VERSION}\""
sbt --client 'set ThisBuild / publishTo := sonatypePublishToBundle.value'
sbt --client 'set ThisBuild / sonatypeCredentialHost := "s01.oss.sonatype.org"'
sbt --client "set ThisBuild / credentials += Credentials(\"Sonatype Nexus Repository Manager\", \"s01.oss.sonatype.org\", \"${SONATYPE_USERNAME}\", \"${SONATYPE_PASSWORD}\")"
sbt --client "set Global / pgpSigningKey := Some(\"${PGP_SIGNING_KEY}\")"
sbt --client "set Global / pgpSigningKey := Some(\"${PGP_SIGNING_KEY_FP}\")"
sbt --client sonatypeBundleClean
sbt --client publishSigned

Expand Down

0 comments on commit a6a8c5d

Please sign in to comment.