diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 7e3f6b6..f2d1e73 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -15,10 +15,10 @@ concurrency: jobs: publish-local: name: Publish local - uses: playframework/.github/.github/workflows/cmd.yml@v2 + uses: playframework/.github/.github/workflows/cmd.yml@v3 with: - java: 11, 8 - scala: 2.13.8, 2.12.16 + java: 17, 11 + scala: 2.13.9, 2.12.17 cmd: sbt ++$MATRIX_SCALA publishLocal # Check that we can actually build and package the library finish: @@ -26,4 +26,4 @@ jobs: if: github.event_name == 'pull_request' needs: # Should be last - "publish-local" - uses: playframework/.github/.github/workflows/rtm.yml@v2 + uses: playframework/.github/.github/workflows/rtm.yml@v3 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..92e6f54 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,15 @@ +name: Publish + +on: + push: + branches: # Snapshots + - main + tags: ["**"] # Releases + release: + types: [published] + +jobs: + publish-artifacts: + name: Publish / Artifacts + uses: playframework/.github/.github/workflows/publish.yml@v3 + secrets: inherit diff --git a/.gitignore b/.gitignore index eb5a316..77c1d5d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ target +.idea/ +.bsp/ diff --git a/project/OmnidocBuild.scala b/project/OmnidocBuild.scala index 1521429..3fa16ce 100644 --- a/project/OmnidocBuild.scala +++ b/project/OmnidocBuild.scala @@ -10,7 +10,7 @@ import sbt.Keys._ import interplay._ import interplay.PlayBuildBase.autoImport._ import xerial.sbt.Sonatype.autoImport.sonatypeProfileName -import sbtrelease.ReleasePlugin.autoImport._ +import sbtdynver.DynVerPlugin.autoImport._ object OmnidocBuild { @@ -99,14 +99,13 @@ object OmnidocBuild { lazy val omnidoc = project .in(file(".")) - .enablePlugins(PlayLibrary, PlayReleaseBase) + .enablePlugins(PlayLibrary) .settings(omnidocSettings) .configs(Omnidoc) def omnidocSettings: Seq[Setting[_]] = projectSettings ++ dependencySettings ++ - releaseSettings ++ inConfig(Omnidoc) { updateSettings ++ extractSettings ++ @@ -118,13 +117,17 @@ object OmnidocBuild { def projectSettings: Seq[Setting[_]] = Seq( name := "play-omnidoc", - version := playVersion, ThisBuild / playBuildRepoName := "omnidoc", crossScalaVersions := Seq(ScalaVersions.scala212, ScalaVersions.scala213), - resolvers ++= Seq( - Resolver.sonatypeRepo("snapshots"), - Resolver.sonatypeRepo("releases")), + resolvers ++= Resolver.sonatypeOssRepos("snapshots") ++ + Resolver.sonatypeOssRepos("releases"), useCoursier := false, // so updatePlaydocClassifiers isn't empty + updateSbtClassifiers / useCoursier := true, // https://github.com/sbt/sbt/issues/5263#issuecomment-626462593 + ThisBuild / dynverVTagPrefix := false, // Customise sbt-dynver's behaviour to make it work with tags which aren't v-prefixed + Global / onLoad := (Global / onLoad).value.andThen { s => + dynverAssertTagVersion.value // Sanity-check: assert that version comes from a tag (e.g. not a too-shallow clone) + s // https://github.com/dwijnand/sbt-dynver/#sanity-checking-the-version + }, ) def dependencySettings: Seq[Setting[_]] = Seq( @@ -138,24 +141,6 @@ object OmnidocBuild { ) ) - def releaseSettings: Seq[Setting[_]] = Seq( - releaseTagName := playVersion, - sonatypeProfileName := "com.typesafe.play", - releaseProcess := { - import ReleaseTransformations._ - - // Since the version comes externally, we don't set or update it here. - Seq[ReleaseStep]( - checkSnapshotDependencies, - tagRelease, - publishArtifacts, - releaseStepCommand("sonatypeBundleRelease"), - pushChanges - ) - } - - ) - def updateSettings: Seq[Setting[_]] = Seq( transitiveClassifiers := Seq(SourceClassifier, PlaydocClassifier), updatePlaydocClassifiers := updatePlaydocClassifiersTask.value @@ -195,12 +180,14 @@ object OmnidocBuild { def compilerReporterSettings = Seq( compile / compilerReporter := { - new sbt.internal.server.LanguageServerReporter( + new sbt.internal.inc.LoggedReporter( maxErrors.value, streams.value.log, foldMappers(sourcePositionMappers.value) ) }, + tastyFiles := (Compile / compile / tastyFiles).value, // not 100% sure but it seems to work + bspReporter := (Compile / compile / bspReporter).value, // same ) private def foldMappers[A](mappers: Seq[A => Option[A]]): A => A = @@ -321,7 +308,7 @@ object OmnidocBuild { "-encoding", "UTF-8", "-source", - "8", + "11", ) } diff --git a/project/build.properties b/project/build.properties index 0837f7a..22af262 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.3.13 +sbt.version=1.7.1 diff --git a/project/plugins.sbt b/project/plugins.sbt index 5bc31f5..adc698a 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1 +1 @@ -addSbtPlugin("com.typesafe.play" % "interplay" % sys.props.getOrElse("interplay.version", "3.0.5")) +addSbtPlugin("com.typesafe.play" % "interplay" % sys.props.getOrElse("interplay.version", "3.1.0-RC3"))