Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to sbt-dynver for versioning. #25

Merged
merged 2 commits into from
Jan 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .github/workflows/sbt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should cause github to fetch tags during checkout.

- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
Expand All @@ -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 }}
Expand Down
22 changes: 4 additions & 18 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
val openApiGeneratorVersion = "5.0.0-beta2"

ThisBuild / name := "sbt-openapi-generator"
ThisBuild / description :=
"""
Expand All @@ -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("[email protected]: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)
Expand Down Expand Up @@ -66,7 +54,5 @@ lazy val `sbt-openapi-generator` = (project in file("."))
devConnection = "scm:git:ssh://[email protected]: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)
4 changes: 3 additions & 1 deletion project/plugin.sbt
Original file line number Diff line number Diff line change
@@ -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")