Skip to content

Commit

Permalink
add publish commands
Browse files Browse the repository at this point in the history
  • Loading branch information
dwickern committed Nov 3, 2023
1 parent cc6b148 commit 3794ee3
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ jobs:
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
CI_RELEASE: publishJdk8
28 changes: 27 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ lazy val root = (project in file("."))
ideSkipProject := false,
compile / skip := true,
publish / skip := true,
commands += testPlayVersionCommand
commands ++= Seq(
testPlayVersionCommand,
publishJdk8,
publishJdk11,
)
)

lazy val swagger = (projectMatrix in file("."))
Expand Down Expand Up @@ -156,6 +160,28 @@ lazy val testPlayVersionCommand = Command.single("testPlayVersion") { case (stat
}
}

lazy val publishJdk8 = Command.command("publishJdk8") { state =>
requireJdkVersion("1.8.x")
publishCommands(play27, play28) ::: state
}

lazy val publishJdk11 = Command.command("publishJdk11") { state =>
requireJdkVersion("11.x")
publishCommands(play28, play30) ::: state
}

def requireJdkVersion(semver: String): Unit = {
val version = VersionNumber(sys.props("java.specification.version"))
if (!version.matchesSemVer(SemanticSelector(semver))) {
sys.error(s"This build requires JDK $semver but found $version")
}
}

def publishCommands(versions: ConfigAxis*): List[String] = {
val projects = versions.toList.flatMap(ver => swagger.finder(ver).get)
projects.map(proj => s"+${proj.id}/publishSigned")
}

Global / excludeLintKeys += ideSkipProject

ThisBuild / homepage := scmInfo.value.map(_.browseUrl)
Expand Down

0 comments on commit 3794ee3

Please sign in to comment.