Skip to content
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
53 changes: 34 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,55 +16,70 @@ on:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


concurrency:
group: ${{ github.workflow }} @ ${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build and Test
name: Test
strategy:
matrix:
os: [ubuntu-latest]
os: [ubuntu-22.04]
scala: [2.12.15, 2.11.12, 2.13.8, 3.0.2]
java: [temurin@8, temurin@11, temurin@17]
runs-on: ${{ matrix.os }}
timeout-minutes: 60
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup sbt
uses: sbt/setup-sbt@v1

- name: Setup Java (temurin@8)
id: setup-java-temurin-8
if: matrix.java == 'temurin@8'
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 8
cache: sbt

- name: sbt update
if: matrix.java == 'temurin@8' && steps.setup-java-temurin-8.outputs.cache-hit == 'false'
run: sbt +update

- name: Setup Java (temurin@11)
id: setup-java-temurin-11
if: matrix.java == 'temurin@11'
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 11
cache: sbt

- name: sbt update
if: matrix.java == 'temurin@11' && steps.setup-java-temurin-11.outputs.cache-hit == 'false'
run: sbt +update

- name: Setup Java (temurin@17)
id: setup-java-temurin-17
if: matrix.java == 'temurin@17'
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
cache: sbt

- name: Cache sbt
uses: actions/cache@v2
with:
path: |
~/.sbt
~/.ivy2/cache
~/.coursier/cache/v1
~/.cache/coursier/v1
~/AppData/Local/Coursier/Cache/v1
~/Library/Caches/Coursier/v1
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
- name: sbt update
if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false'
run: sbt +update

- name: Check that workflows are up to date
run: sbt ++${{ matrix.scala }} githubWorkflowCheck
run: sbt githubWorkflowCheck

- run: sbt ++${{ matrix.scala }} testIfRelevant mimaReportBinaryIssues
- run: sbt '++ ${{ matrix.scala }}' testIfRelevant mimaReportBinaryIssues
16 changes: 16 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,21 @@ lazy val binaryCompatStep = releaseStepCommandAndRemaining("+mimaReportBinaryIss
lazy val testIfRelevantStep = releaseStepCommandAndRemaining("+testIfRelevant")
lazy val publishIfRelevantStep = releaseStepCommandAndRemaining("+publishSignedIfRelevant")

// sonaReleaseIfNecessary is from sbt-typelevel
// https://github.com/typelevel/sbt-typelevel/blob/v0.8.0/sonatype/src/main/scala/org/typelevel/sbt/TypelevelSonatypePlugin.scala#L81-L87
// SPDX-License-Identifier: Apache-2.0
// Copyright 2022 Typelevel
lazy val sonaReleaseIfNecessary: Command =
Command.command("sonaReleaseIfNecessary") { state =>
if (state.getSetting(isSnapshot).getOrElse(false))
state // a snapshot is good-to-go
else // a non-snapshot releases as a bundle
Command.process("sonaRelease", state, _ => ())
}

commands += sonaReleaseIfNecessary
lazy val sonaReleaseIfNecessaryStep = releaseStepCommand("sonaReleaseIfNecessary")

/* This is the standard release process plus a binary compat check after tests */
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
Expand All @@ -24,6 +39,7 @@ releaseProcess := Seq[ReleaseStep](
commitReleaseVersion,
tagRelease,
publishIfRelevantStep,
sonaReleaseIfNecessaryStep,
setNextVersion,
commitNextVersion,
pushChanges
Expand Down
7 changes: 0 additions & 7 deletions project/BasicSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,6 @@ trait BasicSettings extends ProjectSettings { st: SettingTemplate =>
} else {
Seq.empty
}
) ++ (
if (sonatypeResolver) {
/* Many OSS projects push here and then appear in Maven Central later */
Seq(resolvers += Resolver.sonatypeRepo("releases"))
} else {
Seq.empty
}
)
)

Expand Down
12 changes: 5 additions & 7 deletions project/Publish.scala
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import sbt._
import sbt.{Resolvers => _, _}
import Keys._

object Publish {
import Resolvers._
import Helpers._

val sonaCreds = (
Expand All @@ -12,7 +11,7 @@ object Publish {
} yield {
credentials +=
Credentials("Sonatype Nexus Repository Manager",
"oss.sonatype.org",
"central.sonatype.com",
user, pass)
}
).toSeq
Expand All @@ -23,10 +22,9 @@ object Publish {
Test / publishArtifact := false,

publishTo := {
if (version.value.trim endsWith "SNAPSHOT")
Some(sonatypeSnaps)
else
Some(sonatypeStaging)
val centralSnapshots = "https://central.sonatype.com/repository/maven-snapshots/"
if (isSnapshot.value) Some("central-snapshots" at centralSnapshots)
else localStaging.value
},

pomExtra := BasicSettings.developerInfo
Expand Down
8 changes: 0 additions & 8 deletions project/Resolvers.scala

This file was deleted.

2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.6.2
sbt.version=1.11.2
2 changes: 1 addition & 1 deletion project/plugin-github-actions.sbt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
addSbtPlugin("com.codecommit" % "sbt-github-actions" % "0.14.2")
addSbtPlugin("org.typelevel" % "sbt-typelevel-github-actions" % "0.8.0")
4 changes: 0 additions & 4 deletions project/plugin-sonatype.sbt

This file was deleted.

2 changes: 1 addition & 1 deletion version.sbt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version in ThisBuild := "1.10.1-SNAPSHOT"
ThisBuild / version := "1.10.1-SNAPSHOT"