-
Notifications
You must be signed in to change notification settings - Fork 8
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
Migrate to sbt-typelevel and self-host #120
Changes from 2 commits
3b59fc1
582773e
a52a20c
3bac380
4d1bed0
25ea50b
64de78c
d11644b
8e725b7
c627f3d
3249508
b1f2429
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
resolvers += Resolver.sonatypeRepo("snapshots") | ||
addSbtPlugin("org.typelevel" % "sbt-typelevel" % "0.4-91c982a-SNAPSHOT") |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,16 +22,16 @@ import sbt.Keys._ | |
import com.typesafe.sbt.SbtGit.git | ||
import sbtghactions._ | ||
import sbtghactions.GenerativeKeys._ | ||
import sbtspiewak._, SonatypeCiReleasePlugin.autoImport._ | ||
import org.typelevel.sbt._, TypelevelSonatypeCiReleasePlugin.autoImport._ | ||
|
||
object Http4sOrgPlugin extends AutoPlugin { | ||
object autoImport | ||
|
||
override def trigger = allRequirements | ||
|
||
override def requires = SpiewakPlugin && SonatypeCiReleasePlugin | ||
override def requires = TypelevelPlugin | ||
|
||
override def buildSettings = organizationSettings ++ githubActionsSettings ++ http4sStyleSnapshots | ||
override def buildSettings = organizationSettings ++ githubActionsSettings | ||
|
||
val organizationSettings: Seq[Setting[_]] = | ||
Seq( | ||
|
@@ -41,39 +41,15 @@ object Http4sOrgPlugin extends AutoPlugin { | |
|
||
val githubActionsSettings: Seq[Setting[_]] = | ||
Seq( | ||
spiewakMainBranches := Seq("main"), | ||
tlCiReleaseBranches := Seq("main"), | ||
githubWorkflowJavaVersions := List("8", "11", "17").map(JavaSpec.temurin(_)), | ||
githubWorkflowEnv += ("JABBA_INDEX" -> "https://github.com/typelevel/jdk-index/raw/main/index.json"), | ||
githubWorkflowBuild := Seq( | ||
WorkflowStep | ||
.Sbt(List("scalafmtCheckAll", "scalafmtSbtCheck"), name = Some("Check formatting")), | ||
WorkflowStep.Sbt(List("headerCheckAll"), name = Some("Check headers")), | ||
WorkflowStep.Sbt(List("test:compile"), name = Some("Compile")), | ||
WorkflowStep.Sbt(List("mimaReportBinaryIssues"), name = Some("Check binary compatibility")), | ||
githubWorkflowBuild += | ||
WorkflowStep.Sbt( | ||
List("unusedCompileDependenciesTest"), | ||
name = Some("Check unused compile dependencies")), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is something not currently covered in sbt-typelevel. I'm a bit confused, are projects actually using this? If so I should add it back. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. http4s should be. I think it's good POM hygiene, but it's one of my less popular opinions. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've never used it but seems like a good idea. I don't see it in the http4s CI rn: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We had the explicit dependencies check in addition to the unused dependencies check. The former was very controversial, but I'd like to reinstate the latter. |
||
WorkflowStep.Sbt(List("test"), name = Some("Run tests")), | ||
WorkflowStep.Sbt(List("doc"), name = Some("Build docs")) | ||
), | ||
List("doc"), | ||
name = Some("Build docs"), | ||
cond = Some("matrix.ci == '' || matrix.ci == 'ciJVM'")), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So, this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't quite understand it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm trying to account for CI matrices with a JVM/JS axis here. There might be a better way to do this. We only want to run So, what I did was try to run
Of course, we could run this step on all the jobs, but it would be redundant and time-consuming. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixing typelevel/sbt-typelevel#61 would fix this insanity. |
||
githubWorkflowBuildMatrixFailFast := Some(false), | ||
githubWorkflowArtifactUpload := false, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any reason we don't like this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I remember it being an irritant, but don't remember why. I'm happy to try without it. |
||
githubWorkflowTargetBranches := Seq("**") | ||
) | ||
|
||
val http4sStyleSnapshots: Seq[Setting[_]] = | ||
Seq( | ||
isSnapshot := | ||
git.gitCurrentTags.value.isEmpty || git.gitUncommittedChanges.value, | ||
version := { | ||
val v = version.value | ||
val suffix = "-SNAPSHOT" | ||
if (isSnapshot.value && !v.endsWith(suffix)) v + suffix else v | ||
}, | ||
githubWorkflowPublish := Seq( | ||
WorkflowStep.Sbt(List("+publish")), | ||
WorkflowStep | ||
.Sbt(List("sonatypeBundleRelease"), cond = Some("startsWith(github.ref, 'refs/tags/v')")) | ||
) | ||
) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../core/src/main/scala/org/http4s/sbt/Http4sOrgPlugin.scala |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../core/build.sbt |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that I see it from a workflow perspective, I'm not sure I consider this progress. It is now harder to see on what step a build fails.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened typelevel/sbt-typelevel#60 to think about this one.