diff --git a/.github/workflows/sbt.yml b/.github/workflows/sbt.yml index 192bf94..b2832b6 100644 --- a/.github/workflows/sbt.yml +++ b/.github/workflows/sbt.yml @@ -13,12 +13,17 @@ on: pull_request: branches: - 'master' + release: + types: + - 'published' jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Set up JDK 1.8 uses: actions/setup-java@v1 with: @@ -34,9 +39,9 @@ jobs: path: ~/.sbt key: ${{ runner.os }}-sbt-${{ hashFiles('**/*.sbt') }} - name: Run tests - run: sbt '^test; ^scripted;' + run: sbt ^test ^scripted - name: Publish - if: github.ref == 'refs/heads/master' + if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v') env: BINTRAY_USER: ${{ secrets.BINTRAY_USER }} BINTRAY_PASS: ${{ secrets.BINTRAY_PASS }} diff --git a/build.sbt b/build.sbt index 2b2165e..84bef49 100644 --- a/build.sbt +++ b/build.sbt @@ -1,5 +1,3 @@ -val openApiGeneratorVersion = "5.0.0-beta2" - ThisBuild / name := "sbt-openapi-generator" ThisBuild / description := """ @@ -15,23 +13,13 @@ lazy val `sbt-openapi-generator` = (project in file(".")) crossScalaVersions := Seq(scalaVersion.value, "2.11.12"), crossSbtVersions := List("0.13.17", "1.3.10"), sbtPlugin := true, + publishMavenStyle := false, + bintrayRepository := "sbt-plugins", bintrayOrganization := Option("openapitools"), bintrayPackageLabels := Seq("sbt", "plugin", "oas", "openapi", "openapi-generator"), bintrayVcsUrl := Some("git@github.com:OpenAPITools/sbt-openapi-generator.git"), - git.baseVersion := openApiGeneratorVersion.replace("-SNAPSHOT", ""), - git.formattedShaVersion := { - if(isSnapshot.value) { - git.gitHeadCommit.value map { sha => - git.defaultFormatShaVersion( - Some(git.formattedDateVersion.value), - sha.slice(0, 8), - "" - ) - } - } else Option(openApiGeneratorVersion) - }, scriptedLaunchOpts := { scriptedLaunchOpts.value ++ Seq("-Xmx1024M", "-server", "-Dplugin.version=" + version.value) @@ -66,7 +54,5 @@ lazy val `sbt-openapi-generator` = (project in file(".")) devConnection = "scm:git:ssh://git@github.com:OpenAPITools/openapi-generator.git") ), - isSnapshot := openApiGeneratorVersion.endsWith("-SNAPSHOT"), - - libraryDependencies += "org.openapitools" % "openapi-generator" % openApiGeneratorVersion - ).enablePlugins(GitVersioning, SbtPlugin) + libraryDependencies += "org.openapitools" % "openapi-generator" % "5.0.0-beta2" + ).enablePlugins(SbtPlugin) diff --git a/project/plugin.sbt b/project/plugin.sbt index 918cc98..a13d930 100644 --- a/project/plugin.sbt +++ b/project/plugin.sbt @@ -1,3 +1,5 @@ +// Manages publishing. addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.6") -addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "1.0.0") +// Versions the build. +addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.1.1")