Skip to content

Commit 5b67eb6

Browse files
scala-stewardlrytz
authored andcommitted
Update Scala 3 for building sbt 2 plugin to 3.8.1
1 parent 2274aa1 commit 5b67eb6

File tree

3 files changed

+48
-38
lines changed

3 files changed

+48
-38
lines changed

.github/workflows/ci.yml

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ on:
55
push:
66

77
jobs:
8-
build:
8+
core:
99
strategy:
1010
fail-fast: false
1111
matrix:
12-
java: [8, 11, 17]
12+
java: [8, 17, 25]
13+
scala: [2.12.x, 2.13.x, 3.3.x]
1314
runs-on: ubuntu-latest
1415
steps:
1516
- uses: actions/checkout@v6
@@ -19,48 +20,55 @@ jobs:
1920
java-version: ${{matrix.java}}
2021
cache: sbt
2122
- uses: sbt/setup-sbt@v1
22-
# note use of an old sbt version, as a smoke test
23-
- run: "sbt +test mimaReportBinaryIssues 'set sbtplugin/scriptedSbt := \"1.5.8\"' 'scripted sbt-mima-plugin/minimal'"
24-
testFunctional:
25-
needs: build
23+
- run: sbt ++${{matrix.scala}} coreJVM/test coreNative/test cliJVM/test coreJVM/mimaReportBinaryIssues
24+
25+
sbtplugin:
26+
needs: core
2627
strategy:
2728
fail-fast: false
2829
matrix:
29-
scala: [2.11, 2.12, 2.13, 3]
30+
include:
31+
- scala: 2.12.x
32+
java: 8
33+
- scala: 3.8.x
34+
java: 17
3035
runs-on: ubuntu-latest
3136
steps:
3237
- uses: actions/checkout@v6
3338
- uses: actions/setup-java@v5
3439
with:
35-
distribution: zulu
36-
java-version: 8
40+
distribution: temurin
41+
java-version: ${{matrix.java}}
3742
cache: sbt
3843
- uses: sbt/setup-sbt@v1
39-
- run: sbt "functional-tests/runMain com.typesafe.tools.mima.lib.UnitTests -${{ matrix.scala }}"
40-
testScripted:
41-
needs: build
44+
# set ThisBuild/scalaVersion because sbtplugin depends on core, but core stays on 2.12 with `++3.8.x`
45+
- run: sbt ++${{matrix.scala}} 'set ThisBuild/scalaVersion := (sbtplugin/scalaVersion).value' sbtplugin/mimaReportBinaryIssues sbtplugin/scripted
46+
47+
testFunctional:
48+
needs: core
4249
strategy:
4350
fail-fast: false
4451
matrix:
45-
scala: [2.12.x, 3.x]
52+
scala: [2.11, 2.12, 2.13, 3]
4653
runs-on: ubuntu-latest
4754
steps:
4855
- uses: actions/checkout@v6
4956
- uses: actions/setup-java@v5
5057
with:
51-
distribution: zulu
58+
distribution: temurin
5259
java-version: 8
5360
cache: sbt
5461
- uses: sbt/setup-sbt@v1
55-
- run: sbt "++${{ matrix.scala }} sbtplugin/scripted"
62+
- run: sbt "functional-tests/runMain com.typesafe.tools.mima.lib.UnitTests -${{matrix.scala}}"
63+
5664
testIntegration:
57-
needs: build
65+
needs: core
5866
runs-on: ubuntu-latest
5967
steps:
6068
- uses: actions/checkout@v6
6169
- uses: actions/setup-java@v5
6270
with:
63-
distribution: zulu
71+
distribution: temurin
6472
java-version: 8
6573
cache: sbt
6674
- uses: sbt/setup-sbt@v1

.github/workflows/release.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,33 @@
1-
name: Release
1+
name: release
22

33
on:
44
push:
55
tags: ["*"]
66

77
jobs:
88
release:
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
include:
13+
- scala: 2.12.x
14+
java: 8
15+
- scala: 2.13.x
16+
java: 8
17+
- scala: 3.3.x
18+
java: 8
19+
- scala: 3.8.x
20+
java: 17
921
runs-on: ubuntu-latest
1022
steps:
1123
- uses: actions/checkout@v6
12-
with:
13-
fetch-depth: 0
14-
1524
- uses: actions/setup-java@v5
1625
with:
1726
distribution: temurin
18-
java-version: 8
27+
java-version: ${{matrix.java}}
1928
cache: sbt
20-
2129
- uses: sbt/setup-sbt@v1
22-
23-
- run: sbt ci-release
30+
- run: sbt ++${{matrix.scala}} publishSigned
2431
env:
2532
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
2633
PGP_SECRET: ${{ secrets.PGP_SECRET }}

build.sbt

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,6 @@ inThisBuild(Seq(
1212
scmInfo := Some(ScmInfo(url("https://github.com/lightbend-labs/mima"), "scm:git:git@github.com:lightbend-labs/mima.git")),
1313
versionScheme := Some("early-semver"),
1414
scalaVersion := scala212,
15-
// Fallback version when no v-prefixed tags exist (migration from non-v tags to v-prefixed tags)
16-
version := {
17-
val v = version.value
18-
if (v.startsWith("0.0.0+")) {
19-
// No v-prefixed tag found, use 1.1.4 as base (last release before v-prefix migration)
20-
"1.1.4" + v.stripPrefix("0.0.0")
21-
} else v
22-
},
2315
))
2416

2517
def compilerOptions(scalaVersion: String): Seq[String] =
@@ -44,8 +36,8 @@ def compilerOptions(scalaVersion: String): Seq[String] =
4436
// Keep in sync with TestCli
4537
val scala212 = "2.12.21"
4638
val scala213 = "2.13.18"
47-
val scala3 = "3.3.7"
48-
val scala3_7 = "3.7.4"
39+
val scala3 = "3.3.7" // keep at LTS
40+
val scala3_8 = "3.8.1" // keep at 3.8 for sbt 2 plugin
4941

5042
val root = project.in(file(".")).settings(
5143
name := "mima",
@@ -79,7 +71,7 @@ val cli = crossProject(JVMPlatform)
7971
.crossType(CrossType.Pure)
8072
.settings(
8173
name := "mima-cli",
82-
crossScalaVersions ++= Seq(scala3),
74+
crossScalaVersions ++= Seq(scala213, scala3),
8375
scalacOptions ++= compilerOptions(scalaVersion.value),
8476
libraryDependencies += munit.value % Test,
8577
MimaSettings.mimaSettings,
@@ -91,11 +83,11 @@ val cli = crossProject(JVMPlatform)
9183

9284
val sbtplugin = project.enablePlugins(SbtPlugin).dependsOn(core.jvm).settings(
9385
name := "sbt-mima-plugin",
94-
crossScalaVersions ++= Seq(scala3_7),
86+
crossScalaVersions ++= Seq(scala3_8),
9587
(pluginCrossBuild / sbtVersion) := {
9688
scalaBinaryVersion.value match {
9789
case "2.12" => "1.5.8"
98-
case _ => "2.0.0-RC3"
90+
case _ => "2.0.0-RC9"
9991
}
10092
},
10193
scalacOptions ++= compilerOptions(scalaVersion.value),
@@ -104,6 +96,9 @@ val sbtplugin = project.enablePlugins(SbtPlugin).dependsOn(core.jvm).settings(
10496
scriptedLaunchOpts += s"-Dplugin.version=${version.value}",
10597
scriptedLaunchOpts += s"-Dsbt.boot.directory=${file(sys.props("user.home")) / ".sbt" / "boot"}",
10698
MimaSettings.mimaSettings,
99+
// remove once there is a previous `_sbt2_3` sbt plugin release
100+
mimaFailOnNoPrevious := false,
101+
mimaPreviousArtifacts := (if (scalaVersion.value.startsWith("3.8")) Set.empty else mimaPreviousArtifacts.value),
107102
)
108103

109104
val testFunctional = taskKey[Unit]("Run the functional test")

0 commit comments

Comments
 (0)