Skip to content

Commit d3b691e

Browse files
committed
fixes
tested it on a branch, upload to github works now.
1 parent 05c476f commit d3b691e

File tree

11 files changed

+30
-65
lines changed

11 files changed

+30
-65
lines changed

.travis.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ install:
2222
- sudo apt-get install -y rpm
2323

2424
language: scala
25-
jdk: openjdk8
25+
# java 11+ needed for sttp
26+
jdk: openjdk21
2627

2728
env:
2829
global:

admin/build.ps1

+1-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ if ($env:APPVEYOR_FORCED_BUILD -eq 'true') {
3535
clearIvyCache
3636
if ($env:mode -eq 'release') {
3737
echo "Running a release for $env:version"
38-
$repositoriesFile="$env:APPVEYOR_BUILD_FOLDER\conf\repositories"
39-
& cmd /c "sbt ""-Dsbt.override.build.repos=true"" ""-Dsbt.repository.config=$repositoriesFile"" ""-Dproject.version=$env:version"" ""show fullResolvers"" clean update ghUpload" '2>&1'
38+
& cmd /c "sbt ""-Dproject.version=$env:version"" ""show fullResolvers"" clean update ghUpload" '2>&1'
4039
checkExit
4140
} else {
4241
echo "Unknown mode: '$env:mode'"

admin/build.sh

-2
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,8 @@ if [[ "$TRAVIS_EVENT_TYPE" == "api" ]]; then
9292
elif [[ "$mode" == "release" ]]; then
9393
echo "Running a release for $version"
9494
triggerMsiRelease
95-
repositoriesFile="$TRAVIS_BUILD_DIR/conf/repositories"
9695
# The log is too long for the travis UI, so remove ANSI codes to have a clean raw version
9796
sbt -Dsbt.log.noformat=true \
98-
-Dsbt.override.build.repos=true -Dsbt.repository.config="$repositoriesFile" \
9997
-Dproject.version=$version \
10098
"show fullResolvers" clean update ghUpload
10199
triggerSmoketest

appveyor.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ branches:
66
- 2.12.x
77
- 2.13.x
88

9-
image: Visual Studio 2015
9+
image: Visual Studio 2019
1010

1111
environment:
12-
JAVA_HOME: C:\Program Files\Java\jdk1.8.0
12+
# java 11+ needed for sttp
13+
JAVA_HOME: C:\Program Files\Java\jdk21
1314
AWS_ACCESS_KEY_ID:
1415
secure: X1Ix1soRBDMtfbi8IFNPOggDP2XquhW+uKcJ+XC0kiM=
1516
AWS_SECRET_ACCESS_KEY:
@@ -18,7 +19,7 @@ environment:
1819
secure: nfWNfbyzNQwdg1eWHZX93XIJLoAhFOr1fR8+L86s7a3jdo/HydEZ8TyEKsPipQ+/
1920

2021
install:
21-
- cmd: choco install sbt --version=1.3.2 -ia "INSTALLDIR=""C:\sbt"""
22+
- cmd: choco install sbt --version=1.10.11 -ia "INSTALLDIR=""C:\sbt"""
2223
- cmd: SET PATH=C:\sbt\bin;%JAVA_HOME%\bin;%PATH%
2324

2425
build_script:

build.sbt

+17-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import ScalaDist.{s3Upload, ghUpload}
22

3+
resolvers += "scala-integration" at "https://scala-ci.typesafe.com/artifactory/scala-integration/"
4+
35
// so we don't require a native git install
46
useJGit
57

@@ -41,18 +43,30 @@ s3Upload := {
4143

4244
ghUpload := {
4345
import sttp.client3._
46+
import _root_.io.circe._, _root_.io.circe.parser._
4447

4548
val log = streams.value.log
4649
val ghRelease = s"v${(Universal / version).value}"
50+
51+
val token = sys.env.getOrElse("GITHUB_OAUTH_TOKEN", throw new MessageOnlyException("GITHUB_OAUTH_TOKEN missing"))
52+
4753
val backend = HttpURLConnectionBackend()
54+
55+
val rRes = basicRequest
56+
.get(uri"https://api.github.com/repos/scala/scala/releases/tags/$ghRelease")
57+
.header("Accept", "application/vnd.github+json")
58+
.header("Authorization", s"Bearer $token")
59+
.header("X-GitHub-Api-Version", "2022-11-28")
60+
.send(backend)
61+
val releaseId = rRes.body.flatMap(parse).getOrElse(Json.Null).hcursor.downField("id").as[Int].getOrElse(
62+
throw new MessageOnlyException(s"Release not found: $ghRelease"))
63+
4864
(s3Upload / mappings).value map { case (file, _) =>
4965
log.info(s"Uploading ${file.getAbsolutePath} as ${file.getName} to https://github.com/scala/scala/releases/tag/$ghRelease")
5066

51-
val token = sys.env.getOrElse("GITHUB_OAUTH_TOKEN", throw new MessageOnlyException("GITHUB_OAUTH_TOKEN missing"))
52-
5367
// https://docs.github.com/en/rest/releases/assets?apiVersion=2022-11-28#upload-a-release-asset
5468
val request = basicRequest
55-
.post(uri"https://uploads.github.com/repos/scala/scala/releases/${ghRelease}/assets?name=${file.getName}")
69+
.post(uri"https://uploads.github.com/repos/scala/scala/releases/${releaseId}/assets?name=${file.getName}")
5670
.contentType("application/octet-stream")
5771
.header("Accept", "application/vnd.github+json")
5872
.header("Authorization", s"Bearer $token")

conf/repositories

-8
This file was deleted.

project/build.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=1.10.6
1+
sbt.version=1.10.11

project/plugins.sbt

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.8.1")
88
libraryDependencies += "com.amazonaws" % "aws-java-sdk-s3" % "1.12.5"
99

1010
libraryDependencies += "com.softwaremill.sttp.client3" %% "core" % "3.11.0"
11+
libraryDependencies ++= Seq(
12+
"io.circe" %% "circe-core",
13+
"io.circe" %% "circe-generic",
14+
"io.circe" %% "circe-parser"
15+
).map(_ % "0.14.13")
1116

1217
addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "1.0.1")
13-

scripts/jobs/release/package/generic

-32
This file was deleted.

scripts/jobs/release/package/unix

-6
This file was deleted.

scripts/jobs/release/package/windows

-6
This file was deleted.

0 commit comments

Comments
 (0)