-
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.
* Publish to Sonatype * fix organization in sbt-test
- Loading branch information
Showing
6 changed files
with
73 additions
and
34 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 |
---|---|---|
|
@@ -6,6 +6,19 @@ on: | |
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: olafurpg/setup-scala@v10 | ||
with: | ||
java-version: "[email protected]" | ||
- uses: coursier/cache-action@v5 | ||
- uses: jrouly/scalafmt-native-action@v1 | ||
- run: csbt +test +scripted | ||
|
||
release: | ||
needs: [build] | ||
runs-on: ubuntu-latest | ||
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
|
@@ -14,10 +27,11 @@ jobs: | |
with: | ||
java-version: "[email protected]" | ||
- uses: coursier/cache-action@v5 | ||
- uses: jrouly/scalafmt-native-action@v1 | ||
- run: csbt ^test ^scripted | ||
- run: csbt ^publish | ||
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v') | ||
- uses: crazy-max/ghaction-import-gpg@v3 | ||
with: | ||
gpg-private-key: ${{ secrets.GPG_SECRET_KEY }} | ||
passphrase: ${{ secrets.GPG_PASSPHRASE }} | ||
- run: csbt +publishSigned | ||
env: | ||
ARTIFACTORY_USER: ${{ secrets.ARTIFACTORY_USER }} | ||
ARTIFACTORY_PASS: ${{ secrets.ARTIFACTORY_PASS }} | ||
SONATYPE_USER: ${{ secrets.SONATYPE_USER }} | ||
SONATYPE_PASS: ${{ secrets.SONATYPE_PASS }} |
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
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,36 +1,21 @@ | ||
name := "sbt-openapi-diff" | ||
organization := "org.openapitools.openapidiff" | ||
organization := "net.rouly" | ||
description := "Supports functionality from openapi-diff as part of an sbt build." | ||
|
||
homepage := Some(url("https://github.com/jrouly/sbt-openapi-diff")) | ||
licenses := Seq("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")) | ||
|
||
scriptedBufferLog := false | ||
scriptedLaunchOpts ++= Seq("-Xmx1024M", "-server", "-Dplugin.version=" + version.value) | ||
|
||
Global / onChangedBuildSource := ReloadOnSourceChanges | ||
|
||
enablePlugins(SbtPlugin) | ||
sbtPlugin := true | ||
|
||
crossSbtVersions := List( | ||
"0.13.18", | ||
"1.1.6" // https://github.com/sbt/sbt/issues/5049 | ||
) | ||
|
||
libraryDependencies += "org.openapitools.openapidiff" % "openapi-diff-core" % "2.0.0-beta.6" | ||
libraryDependencies += "org.openapitools.openapidiff" % "openapi-diff-core" % "2.0.0" | ||
|
||
credentials += Credentials( | ||
"Artifactory Realm", | ||
"jrouly.jfrog.io", | ||
sys.env.getOrElse("ARTIFACTORY_USER", "user"), | ||
sys.env.getOrElse("ARTIFACTORY_PASS", "pass") | ||
) | ||
crossScalaVersions := Seq("2.10.7", "2.12.10") | ||
|
||
publishMavenStyle := false | ||
publishTo := { | ||
def resolver(host: String, repo: String) = | ||
Resolver.url(repo, url(s"https://$host/artifactory/$repo"))(Resolver.ivyStylePatterns) | ||
if (isSnapshot.value) Some(resolver("jrouly.jfrog.io", "ivy-snapshot-local")) | ||
else Some(resolver("jrouly.jfrog.io", "ivy-release-local")) | ||
pluginCrossBuild / sbtVersion := { | ||
scalaBinaryVersion.value match { | ||
case "2.10" => "0.13.18" | ||
case "2.12" => "1.1.6" // https://github.com/sbt/sbt/issues/5049 | ||
} | ||
} |
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 @@ | ||
// Versions the build. | ||
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.1.1") | ||
|
||
// Sign releases. | ||
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import com.jsuereth.sbtpgp.PgpKeys.publishSigned | ||
import sbt._ | ||
|
||
organizationHomepage := Some(url("https://openapi-generator.tech/")) | ||
homepage := Some(url("https://openapi-generator.tech/")) | ||
licenses := Seq("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")) | ||
|
||
scmInfo := Some( | ||
ScmInfo( | ||
url("https://github.com/jrouly/sbt-openapi-diff"), | ||
"scm:[email protected]:jrouly/sbt-openapi-diff.git" | ||
) | ||
) | ||
|
||
developers := List( | ||
Developer( | ||
id = "jrouly", | ||
name = "Michel Rouly", | ||
email = "[email protected]", | ||
url = url("https://michel.rouly.net") | ||
) | ||
) | ||
|
||
credentials += Credentials( | ||
realm = "Sonatype Nexus Repository Manager", | ||
host = "s01.oss.sonatype.org", | ||
userName = sys.env.getOrElse("SONATYPE_USER", "username"), | ||
passwd = sys.env.getOrElse("SONATYPE_PASS", "password") | ||
) | ||
|
||
pomIncludeRepository := { _ => false } | ||
pgpSigningKey := Some("0xFA8B833314500A89") | ||
|
||
publishMavenStyle := true | ||
|
||
publishTo := Some { | ||
val nexus = "https://s01.oss.sonatype.org/" | ||
if (isSnapshot.value) "snapshots" at nexus + "content/repositories/snapshots" | ||
else "releases" at nexus + "service/local/staging/deploy/maven2" | ||
} |
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