-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: SKFP-905 deploy artefact to sonatype (#7)
- Loading branch information
1 parent
42ce27f
commit fb27bb6
Showing
4 changed files
with
90 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Publish Artifact | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
release: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'adopt' | ||
java-version: '11' | ||
- name: Import GPG key | ||
id: import_gpg | ||
uses: crazy-max/ghaction-import-gpg@v5 | ||
with: | ||
gpg_private_key: ${{ secrets.OSS_SONATYPE_GPG_PRIVATE_KEY }} | ||
passphrase: ${{ secrets.OSS_SONATYPE_GPG_PASSPHRASE }} | ||
git_user_signingkey: false | ||
|
||
- name: Publish Artifact | ||
shell: bash | ||
env: | ||
tag: ${{ github.ref_name }} | ||
SONATYPE_REALM: $OSS_SONATYPE_REALM | ||
SONATYPE_HOST: $OSS_SONATYPE_HOST | ||
SONATYPE_USERNAME: ${{ secrets.OSS_SONATYPE_USERNAME }} | ||
SONATYPE_PASSWORD: ${{ secrets.OSS_SONATYPE_PASSWORD }} | ||
run: | | ||
export PGP_PASSPHRASE=${{ secrets.OSS_SONATYPE_GPG_PASSPHRASE }} | ||
# Remove the leading 'v' from the tag string | ||
export VERSION=${tag#v} | ||
sbt 'publishSigned; sonatypeRelease' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
sbt.version=1.3.13 | ||
sbt.version=1.6.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.6") | ||
|
||
addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "1.0.0") | ||
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2") | ||
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.0.15") | ||
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.13") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
ThisBuild / sonatypeCredentialHost := sys.env.getOrElse("SONATYPE_HOST", "s01.oss.sonatype.org") | ||
ThisBuild / credentials += sys.env.get("SONATYPE_USERNAME").map(username => Credentials(sys.env("SONATYPE_REALM"), sys.env("SONATYPE_HOST"), username, sys.env("SONATYPE_PASSWORD"))).getOrElse(Credentials(Path.userHome / ".sbt" / "sonatype_credentials")) | ||
ThisBuild / releasePublishArtifactsAction := PgpKeys.publishSigned.value | ||
ThisBuild / fork := true | ||
ThisBuild / versionScheme := Some("semver-spec") | ||
ThisBuild / organization := "bio.ferlab" | ||
ThisBuild / organizationName := "ferlab" | ||
ThisBuild / organizationHomepage := Some(url("https://github.com/Ferlab-Ste-Justine")) | ||
|
||
ThisBuild / scmInfo := Some( | ||
ScmInfo( | ||
url("https://github.com/Ferlab-Ste-Justine/obo-parser"), | ||
"scm:[email protected]:Ferlab-Ste-Justine/obo-parser.git" | ||
) | ||
) | ||
|
||
ThisBuild / developers := List( | ||
Developer( | ||
id = "adipaul1981", | ||
name = "Adrian Paul", | ||
email = "[email protected]", | ||
url = url("https://github.com/adipaul1981") | ||
), | ||
Developer( | ||
id = "jecos", | ||
name = "Jeremy Costanza", | ||
email = "[email protected]", | ||
url = url("https://github.com/jecos") | ||
) | ||
) | ||
ThisBuild / description := "Library built on top of Apache Spark to speed-up data lakes development.." | ||
ThisBuild / licenses := List("Apache 2" -> new URL("http://www.apache.org/licenses/LICENSE-2.0.txt")) | ||
ThisBuild / homepage := Some(url("https://github.com/Ferlab-Ste-Justine/obo-parser")) | ||
|
||
import sbt.url | ||
import xerial.sbt.Sonatype._ | ||
|
||
ThisBuild / sonatypeProjectHosting := Some(GitHubHosting("Ferlab Ste-Justine", "obo-parser", "[email protected]")) | ||
// Remove all additional repository other than Maven Central from POM | ||
ThisBuild / pomIncludeRepository := { _ => false } | ||
ThisBuild / publishTo := { | ||
val nexus = "https://s01.oss.sonatype.org/" | ||
if (isSnapshot.value) Some("snapshots" at nexus + "content/repositories/snapshots") | ||
else Some("releases" at nexus + "service/local/staging/deploy/maven2") | ||
} | ||
ThisBuild / publishMavenStyle := true |