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

chore: Migrate project to sbt-projectmatrix #33

Merged
merged 7 commits into from
Mar 15, 2024
Merged

Conversation

ghostbuster91
Copy link
Collaborator

@ghostbuster91 ghostbuster91 commented Mar 14, 2024

Migrate project to sbt-projectmatrix. This is a prerequisite for #32

@ghostbuster91 ghostbuster91 changed the title feat: Add support for scalajs chore: Migrate project to sbt-projectmatrix Mar 14, 2024

ThisBuild / githubWorkflowBuildSbtStepPreamble := Seq.empty

ThisBuild / githubWorkflowArtifactUpload := false
Copy link
Collaborator Author

@ghostbuster91 ghostbuster91 Mar 14, 2024

Choose a reason for hiding this comment

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

I had to disable uploading of artifacts as sbt-gha does not generate list of artifacts to upload based on the matrix values but it generates it for all modules and there is no builtin way to configure it to this use-case. It fails with directory does not exist in our case as jvm-2.13 is not present when building for scala 3. There a workaround mentioned in sbt/sbt-github-actions#9 but I think that it doesn't apply to our case.

Maybe this can be fixed by overriding githubWorkflowGeneratedUploadSteps but readme discourages such actions.

// Add makeMicrosite to the build step
ThisBuild / githubWorkflowBuild ~= { steps =>
steps.map {
case w: WorkflowStep.Sbt if w.commands == List("test") =>
w.copy(commands = List("test", "makeMicrosite", "publishLocal"))
w.copy(commands =
List("test", "publishLocal").map(_ + "_${{ matrix.scala }}_${{ matrix.scalaPlatform }}") :+ "makeMicrosite",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

makeMicrosite will be run for every build matrix entry which is not ideal but I didn't find a way to make it conditional only for 2.13.

Copy link
Owner

Choose a reason for hiding this comment

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

Thanks no biggie we can fix that later.

@ghostbuster91
Copy link
Collaborator Author

It seems that sbt-github-actions doesn't work well with sbt-projectmatrix. You might want to consider switching to https://typelevel.org/sbt-typelevel/gha.html which I heard does slightly better job.

@ghostbuster91 ghostbuster91 marked this pull request as ready for review March 14, 2024 16:26
@jatcwang jatcwang merged commit 14b2840 into master Mar 15, 2024
7 checks passed
@jatcwang jatcwang deleted the feature/scalajs branch March 15, 2024 13:26
@jatcwang
Copy link
Owner

Happy to switch to use https://typelevel.org/sbt-typelevel/gha.html it has some niceties OOTB👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants