Skip to content

Commit a3a2908

Browse files
authored
Merge pull request #604 from http4s/update/sbt-http4s-org-0.10.0
Update to sbt-http4s-org-0.10.0
2 parents 43f8015 + ebd7320 commit a3a2908

File tree

4 files changed

+107
-58
lines changed

4 files changed

+107
-58
lines changed

Diff for: .github/workflows/ci.yml

+84-16
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ on:
1212
branches: ['**']
1313
push:
1414
branches: ['**']
15-
tags: [v*, v*]
15+
tags: [v*]
1616

1717
env:
18+
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
1819
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
19-
JABBA_INDEX: 'https://github.com/typelevel/jdk-index/raw/main/index.json'
2020
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
2121
PGP_SECRET: ${{ secrets.PGP_SECRET }}
2222
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -28,19 +28,21 @@ jobs:
2828
fail-fast: false
2929
matrix:
3030
os: [ubuntu-latest]
31-
scala: [2.12.15, 2.13.8, 3.0.2]
32-
java: [adoptium@8]
31+
scala: [3.0.2, 2.12.15, 2.13.8]
32+
java: [temurin@8]
3333
runs-on: ${{ matrix.os }}
3434
steps:
3535
- name: Checkout current branch (full)
3636
uses: actions/checkout@v2
3737
with:
3838
fetch-depth: 0
3939

40-
- name: Setup Java and Scala
41-
uses: olafurpg/setup-scala@v13
40+
- name: Setup Java (temurin@8)
41+
if: matrix.java == 'temurin@8'
42+
uses: actions/setup-java@v2
4243
with:
43-
java-version: ${{ matrix.java }}
44+
distribution: temurin
45+
java-version: 8
4446

4547
- name: Cache sbt
4648
uses: actions/cache@v2
@@ -55,9 +57,37 @@ jobs:
5557
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
5658

5759
- name: Check that workflows are up to date
58-
run: sbt ++${{ matrix.scala }} githubWorkflowCheck
60+
run: sbt '++${{ matrix.scala }}' 'project /' githubWorkflowCheck
5961

60-
- run: sbt ++${{ matrix.scala }} validate-ci
62+
- name: Check headers and formatting
63+
run: sbt '++${{ matrix.scala }}' headerCheckAll scalafmtCheckAll 'project /' scalafmtSbtCheck
64+
65+
- name: Test
66+
run: sbt '++${{ matrix.scala }}' test
67+
68+
- name: Check binary compatibility
69+
run: sbt '++${{ matrix.scala }}' mimaReportBinaryIssues
70+
71+
- name: Generate API documentation
72+
run: sbt '++${{ matrix.scala }}' doc
73+
74+
- name: Check Java formatting
75+
run: sbt '++${{ matrix.scala }}' '${{ matrix.ci }}' javafmtCheckAll
76+
77+
- name: Check unused compile dependencies
78+
run: sbt '++${{ matrix.scala }}' unusedCompileDependenciesTest
79+
80+
- name: Make target directories
81+
run: mkdir -p target examples/target http/target core/target testkit/target project/target
82+
83+
- name: Compress target directories
84+
run: tar cf targets.tar target examples/target http/target core/target testkit/target project/target
85+
86+
- name: Upload target directories
87+
uses: actions/upload-artifact@v2
88+
with:
89+
name: target-${{ matrix.os }}-${{ matrix.scala }}-${{ matrix.java }}
90+
path: targets.tar
6191

6292
publish:
6393
name: Publish Artifacts
@@ -67,18 +97,20 @@ jobs:
6797
matrix:
6898
os: [ubuntu-latest]
6999
scala: [2.13.8]
70-
java: [adoptium@8]
100+
java: [temurin@8]
71101
runs-on: ${{ matrix.os }}
72102
steps:
73103
- name: Checkout current branch (full)
74104
uses: actions/checkout@v2
75105
with:
76106
fetch-depth: 0
77107

78-
- name: Setup Java and Scala
79-
uses: olafurpg/setup-scala@v13
108+
- name: Setup Java (temurin@8)
109+
if: matrix.java == 'temurin@8'
110+
uses: actions/setup-java@v2
80111
with:
81-
java-version: ${{ matrix.java }}
112+
distribution: temurin
113+
java-version: 8
82114

83115
- name: Cache sbt
84116
uses: actions/cache@v2
@@ -92,10 +124,46 @@ jobs:
92124
~/Library/Caches/Coursier/v1
93125
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
94126

127+
- name: Download target directories (3.0.2)
128+
uses: actions/download-artifact@v2
129+
with:
130+
name: target-${{ matrix.os }}-3.0.2-${{ matrix.java }}
131+
132+
- name: Inflate target directories (3.0.2)
133+
run: |
134+
tar xf targets.tar
135+
rm targets.tar
136+
137+
- name: Download target directories (2.12.15)
138+
uses: actions/download-artifact@v2
139+
with:
140+
name: target-${{ matrix.os }}-2.12.15-${{ matrix.java }}
141+
142+
- name: Inflate target directories (2.12.15)
143+
run: |
144+
tar xf targets.tar
145+
rm targets.tar
146+
147+
- name: Download target directories (2.13.8)
148+
uses: actions/download-artifact@v2
149+
with:
150+
name: target-${{ matrix.os }}-2.13.8-${{ matrix.java }}
151+
152+
- name: Inflate target directories (2.13.8)
153+
run: |
154+
tar xf targets.tar
155+
rm targets.tar
156+
95157
- name: Import signing key
158+
if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE == ''
96159
run: echo $PGP_SECRET | base64 -d | gpg --import
97160

98-
- run: sbt ++${{ matrix.scala }} +publish
161+
- name: Import signing key and strip passphrase
162+
if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE != ''
163+
run: |
164+
echo "$PGP_SECRET" | base64 -d > /tmp/signing-key.gpg
165+
echo "$PGP_PASSPHRASE" | gpg --pinentry-mode loopback --passphrase-fd 0 --import /tmp/signing-key.gpg
166+
(echo "$PGP_PASSPHRASE"; echo; echo) | gpg --command-fd 0 --pinentry-mode loopback --change-passphrase $(gpg --list-secret-keys --with-colons 2> /dev/null | grep '^sec:' | cut --delimiter ':' --fields 5 | tail -n 1)
99167
100-
- if: startsWith(github.ref, 'refs/tags/v')
101-
run: sbt ++${{ matrix.scala }} sonatypeBundleRelease
168+
- name: Publish
169+
run: sbt '++${{ matrix.scala }}' tlRelease

Diff for: build.sbt

+15-41
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,21 @@
11
import com.typesafe.tools.mima.core._
22
import Dependencies._
33

4-
ThisBuild / publishGithubUser := "rossabaker"
5-
ThisBuild / publishFullName := "Ross A. Baker"
6-
ThisBuild / baseVersion := "0.15"
7-
8-
ThisBuild / versionIntroduced := Map(
9-
"2.13" -> "0.14.5",
10-
"3.0.0-M3" -> "0.15.0",
11-
"3.0.0-RC1" -> "0.15.0",
12-
"3.0.0-RC2" -> "0.15.0",
13-
"3.0.0-RC3" -> "0.15.0"
14-
)
15-
164
val Scala212 = "2.12.15"
175
val Scala213 = "2.13.8"
186
val Scala3 = "3.0.2"
197

20-
ThisBuild / crossScalaVersions := Seq(Scala212, Scala213, Scala3)
8+
ThisBuild / crossScalaVersions := Seq(Scala3, Scala212, Scala213)
219
ThisBuild / scalaVersion := crossScalaVersions.value.filter(_.startsWith("2.")).last
10+
ThisBuild / tlBaseVersion := "0.15"
11+
ThisBuild / tlVersionIntroduced := Map(
12+
"2.13" -> "0.14.5",
13+
"3" -> "0.15.0"
14+
)
15+
ThisBuild / tlFatalWarningsInCi := !tlIsScala3.value // See SSLStage
16+
17+
// 11 and 17 blocked by https://github.com/http4s/blaze/issues/376
18+
ThisBuild / githubWorkflowJavaVersions := Seq(JavaSpec.temurin("8"))
2219

2320
lazy val commonSettings = Seq(
2421
description := "NIO Framework for Scala",
@@ -51,35 +48,17 @@ lazy val commonSettings = Seq(
5148
5249
url("https://github.com/ChristopherDavenport"))
5350
),
54-
licenses := Seq("Apache-2.0" -> url("https://www.apache.org/licenses/LICENSE-2.0.html")),
55-
homepage := Some(url("https://github.com/http4s/blaze")),
56-
scmInfo := Some(
57-
ScmInfo(
58-
url("https://github.com/http4s/blaze"),
59-
"scm:git:https://github.com/http4s/blaze.git",
60-
Some("scm:git:[email protected]:http4s/blaze.git")
61-
)
62-
),
63-
startYear := Some(2014),
64-
libraryDependencies ++= (
65-
if (ScalaArtifacts.isScala3(scalaVersion.value)) Nil
66-
else
67-
Seq(
68-
compilerPlugin(kindProjector.cross(CrossVersion.full))
69-
)
70-
)
51+
startYear := Some(2014)
7152
)
7253

73-
ThisBuild / githubWorkflowJavaVersions := Seq("adoptium@8")
74-
75-
ThisBuild / githubWorkflowTargetTags ++= Seq("v*")
76-
7754
// currently only publishing tags
7855
ThisBuild / githubWorkflowPublishTargetBranches :=
7956
Seq(RefPredicate.StartsWith(Ref.Tag("v")), RefPredicate.Equals(Ref.Branch("main")))
8057

81-
ThisBuild / githubWorkflowBuild := Seq(
82-
WorkflowStep.Sbt(List("validate-ci"))
58+
ThisBuild / githubWorkflowBuild ++= Seq(
59+
WorkflowStep.Sbt(
60+
List("${{ matrix.ci }}", "javafmtCheckAll"),
61+
name = Some("Check Java formatting"))
8362
)
8463

8564
lazy val blaze = project
@@ -150,8 +129,3 @@ lazy val examples = Project("blaze-examples", file("examples"))
150129
addCommandAlias(
151130
"validate",
152131
";scalafmtCheckAll ;scalafmtSbtCheck ;javafmtCheckAll ;+test:compile ;test ;unusedCompileDependenciesTest ;mimaReportBinaryIssues")
153-
154-
// use it in the CI pipeline
155-
addCommandAlias(
156-
"validate-ci",
157-
";scalafmtCheckAll ;scalafmtSbtCheck ;javafmtCheckAll ;test ;unusedCompileDependenciesTest ;mimaReportBinaryIssues")

Diff for: core/src/main/scala/org/http4s/blaze/pipeline/stages/SSLStage.scala

+7
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,13 @@ final class SSLStage(engine: SSLEngine, maxWrite: Int = 1024 * 1024)
236236
case DelayedRead(sz, p) => doRead(sz, p)
237237
case DelayedWrite(d, p) => doWrite(d, p)
238238
}
239+
240+
case unexpected =>
241+
// This warns as unreachable on Scala 3 / Java 8, but does
242+
// not warn on Scala 2, so we can't use @nowarn.
243+
244+
// Java 9 adds NEED_UNWRAP_AGAIN, which only applies to DTLS
245+
handshakeFailure(util.bug(s"Unknown status: ${unexpected}"))
239246
}
240247

241248
val start = System.nanoTime

Diff for: project/plugins.sbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.10.0")
22
addSbtPlugin("com.lightbend.sbt" % "sbt-java-formatter" % "0.7.0")
33
addSbtPlugin("io.spray" % "sbt-revolver" % "0.9.1")
4-
addSbtPlugin("org.http4s" %% "sbt-http4s-org" % "0.8.3")
4+
addSbtPlugin("org.http4s" %% "sbt-http4s-org" % "0.10.0")
55
addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "1.0.0")

0 commit comments

Comments
 (0)