diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..c73241a --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,23 @@ +name: Release +on: + push: + branches: [master, main] + tags: ["*"] +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: actions/setup-java@v3 + with: + distribution: temurin + java-version: 8 + cache: sbt + - run: sbt ci-release + env: + PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} + PGP_SECRET: ${{ secrets.PGP_SECRET }} + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} + SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} diff --git a/RELEASING.md b/RELEASING.md deleted file mode 100644 index 6e51f23..0000000 --- a/RELEASING.md +++ /dev/null @@ -1,7 +0,0 @@ -Releasing sbt-osgi -================== - -1. Grep replace all current versions in `version.sbt` (and `README.md`) to the new version -1. Tag a new version (e.g. `git tag v9.x.x`) -1. Perform the release `sbt release` -1. `git push && git push --tags` diff --git a/bintray.sbt b/bintray.sbt deleted file mode 100644 index aeac541..0000000 --- a/bintray.sbt +++ /dev/null @@ -1,3 +0,0 @@ -bintrayRepository := "sbt-plugins" - -bintrayOrganization := None diff --git a/build.sbt b/build.sbt index 4a5afe6..89d18b6 100644 --- a/build.sbt +++ b/build.sbt @@ -1,22 +1,46 @@ -organization := "com.typesafe.sbt" - -name := "sbt-osgi" - -enablePlugins(SbtPlugin) - -licenses += ("Apache-2.0", url("https://www.apache.org/licenses/LICENSE-2.0.html")) - -libraryDependencies ++= Dependencies.sbtOsgi - lazy val scala212 = "2.12.18" ThisBuild / crossScalaVersions := Seq(scala212) ThisBuild / scalaVersion := scala212 +ThisBuild / dynverSonatypeSnapshots := true +ThisBuild / version := { + val orig = (ThisBuild / version).value + if (orig.endsWith("-SNAPSHOT")) "0.10.0-SNAPSHOT" + else orig +} +name := "sbt-osgi" +enablePlugins(SbtPlugin) +libraryDependencies ++= Dependencies.sbtOsgi scalacOptions ++= Seq( "-unchecked", "-deprecation", "-Xlint", "-encoding", "UTF-8" ) +(pluginCrossBuild / sbtVersion) := { + scalaBinaryVersion.value match { + case "2.12" => "1.2.8" + } +} +scriptedLaunchOpts += "-Xmx1024m" +scriptedLaunchOpts += s"-Dproject.version=${version.value}" +// scriptedBufferLog := false -publishMavenStyle := false +ThisBuild / licenses += ("Apache-2.0", url("https://www.apache.org/licenses/LICENSE-2.0.html")) +ThisBuild / organization := "com.github.sbt" +ThisBuild / homepage := Some(url("https://github.com/sbt/sbt-osgi")) +ThisBuild / scmInfo := Some( + ScmInfo( + url("https://github.com/sbt/sbt-osgi"), + "scm:git@github.com:sbt/sbt-osgi.git" + ) +) +ThisBuild / description := "sbt plugin for creating OSGi bundles" +ThisBuild / developers := List( + Developer( + id = "hseeberger", + name = "Heiko Seeberger", + email = "@hseeberger", + url = url("https://github.com/hseeberger") + ), +) diff --git a/project/Dependencies.scala b/project/Dependencies.scala index b3b1db6..95bea7c 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -17,5 +17,5 @@ object Dependencies { val sbtOsgi = List( bndLib, - specs2 % "test") + specs2 % Test) } diff --git a/project/plugins.sbt b/project/plugins.sbt index dd4e7d1..bed5bbb 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,5 +1,2 @@ -addSbtPlugin("org.scalariform" % "sbt-scalariform" % "1.8.0") - -addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.1") - -libraryDependencies += ("org.scala-sbt" %% "scripted-plugin" % sbtVersion.value) +addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12") +addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2") diff --git a/scalariform.sbt b/scalariform.sbt deleted file mode 100644 index cb37dcf..0000000 --- a/scalariform.sbt +++ /dev/null @@ -1,4 +0,0 @@ -import scalariform.formatter.preferences.AlignSingleLineCaseStatements -import com.typesafe.sbt.SbtScalariform.ScalariformKeys - -ScalariformKeys.preferences := ScalariformKeys.preferences.value.setPreference(AlignSingleLineCaseStatements, true) diff --git a/scripted.sbt b/scripted.sbt deleted file mode 100644 index bc11dff..0000000 --- a/scripted.sbt +++ /dev/null @@ -1,6 +0,0 @@ - -scriptedLaunchOpts += "-Xmx1024m" - -scriptedLaunchOpts += s"-Dproject.version=${version.value}" - -// scriptedBufferLog := false diff --git a/version.sbt b/version.sbt deleted file mode 100644 index 3f7bc69..0000000 --- a/version.sbt +++ /dev/null @@ -1,2 +0,0 @@ -version in ThisBuild := "0.9.7-SNAPSHOT" -