Skip to content

Commit 8090ed2

Browse files
committed
Increase timeout for uploading to GitHub
1 parent 406cac5 commit 8090ed2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

build.sbt

+4-2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ s3Upload := {
4444
ghUpload := {
4545
import sttp.client3._
4646
import _root_.io.circe._, _root_.io.circe.parser._
47+
import scala.concurrent.duration._
4748

4849
val log = streams.value.log
4950
val ghRelease = s"v${(Universal / version).value}"
@@ -65,15 +66,16 @@ ghUpload := {
6566
log.info(s"Uploading ${file.getAbsolutePath} as ${file.getName} to https://github.com/scala/scala/releases/tag/$ghRelease")
6667

6768
// https://docs.github.com/en/rest/releases/assets?apiVersion=2022-11-28#upload-a-release-asset
68-
val request = basicRequest
69+
val response = basicRequest
6970
.post(uri"https://uploads.github.com/repos/scala/scala/releases/${releaseId}/assets?name=${file.getName}")
7071
.contentType("application/octet-stream")
7172
.header("Accept", "application/vnd.github+json")
7273
.header("Authorization", s"Bearer $token")
7374
.header("X-GitHub-Api-Version", "2022-11-28")
7475
.body(file)
76+
.readTimeout(15.minutes) // .deb is 650+ MB (API docs are not zipped... scala/scala-dist#189)
77+
.send(backend)
7578

76-
val response = request.send(backend)
7779
if (response.code.code != 201)
7880
throw new MessageOnlyException(s"Upload failed: status=${response.code}\n${response.body}")
7981
}

0 commit comments

Comments
 (0)