Skip to content

Commit be075f2

Browse files
authored
Merge pull request #78 from com-lihaoyi/publish-scala-2.11
Publish for Scala 2.11
2 parents 5cf4450 + 35d20be commit be075f2

File tree

5 files changed

+61
-36
lines changed

5 files changed

+61
-36
lines changed

.github/workflows/actions.yml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
pull_request:
6+
branches:
7+
- master
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: actions/setup-java@v1
15+
with:
16+
java-version: 8
17+
- name: Run tests
18+
run: ./mill -i __.publishArtifacts __.test
19+
20+
publish-sonatype:
21+
if: github.repository == 'com-lihaoyi/requests-scala' && contains(github.ref, 'refs/tags/')
22+
needs: test
23+
runs-on: ubuntu-latest
24+
env:
25+
SONATYPE_PGP_PRIVATE_KEY: ${{ secrets.SONATYPE_PGP_PRIVATE_KEY }}
26+
SONATYPE_PGP_PRIVATE_KEY_PASSWORD: ${{ secrets.SONATYPE_PGP_PRIVATE_KEY_PASSWORD }}
27+
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
28+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
29+
LANG: "en_US.UTF-8"
30+
LC_MESSAGES: "en_US.UTF-8"
31+
LC_ALL: "en_US.UTF-8"
32+
steps:
33+
- uses: actions/checkout@v2
34+
- uses: actions/setup-java@v1
35+
with:
36+
java-version: 8
37+
- name: Publish to Maven Central
38+
run: |
39+
if [[ $(git tag --points-at HEAD) != '' ]]; then
40+
echo $SONATYPE_PGP_PRIVATE_KEY | base64 --decode > gpg_key
41+
gpg --import --no-tty --batch --yes gpg_key
42+
rm gpg_key
43+
./mill -i mill.scalalib.PublishModule/publishAll \
44+
--sonatypeCreds $SONATYPE_USER:$SONATYPE_PASSWORD \
45+
--gpgArgs --passphrase=$SONATYPE_PGP_PRIVATE_KEY_PASSWORD,--no-tty,--pinentry-mode,loopback,--batch,--yes,-a,-b \
46+
--publishArtifacts __.publishArtifacts \
47+
--readTimeout 600000 \
48+
--awaitTimeout 600000 \
49+
--release true \
50+
--signed true
51+
fi

.travis.yml

-18
This file was deleted.

build.sc

+6-14
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import mill._
22
import mill.scalalib.publish.{Developer, License, PomSettings, VersionControl}
33
import scalalib._
4+
import $ivy.`de.tototec::de.tobiasroeser.mill.vcs.version_mill0.9:0.1.1`
5+
import de.tobiasroeser.mill.vcs.version.VcsVersion
46

57
val dottyVersion = Option(sys.props("dottyVersion"))
68

7-
object requests extends Cross[RequestsModule]((List("2.12.6", "2.13.0", "3.0.0-RC1") ++ dottyVersion): _*)
9+
object requests extends Cross[RequestsModule]((List("2.12.6", "2.13.0", "2.11.12", "3.0.0-RC1") ++ dottyVersion): _*)
810
class RequestsModule(val crossScalaVersion: String) extends CrossScalaModule with PublishModule {
9-
def publishVersion = "0.6.5"
11+
def publishVersion = VcsVersion.vcsState().format()
1012
def artifactName = "requests"
1113
def pomSettings = PomSettings(
1214
description = "Scala port of the popular Python Requests HTTP client",
@@ -19,23 +21,13 @@ class RequestsModule(val crossScalaVersion: String) extends CrossScalaModule wit
1921
)
2022
)
2123
def ivyDeps = Agg(
22-
ivy"com.lihaoyi::geny::0.6.5"
24+
ivy"com.lihaoyi::geny::0.6.7"
2325
)
2426
object test extends Tests{
2527
def ivyDeps = Agg(
2628
ivy"com.lihaoyi::utest::0.7.7",
27-
ivy"com.lihaoyi::ujson::1.2.3"
29+
ivy"com.lihaoyi::ujson::1.3.9"
2830
)
2931
def testFrameworks = Seq("utest.runner.Framework")
3032
}
31-
// FIXME: scaladoc 3 is not supported by mill yet. Remove the override
32-
// once it is.
33-
override def docJar =
34-
if (crossScalaVersion.startsWith("2")) super.docJar
35-
else T {
36-
val outDir = T.ctx().dest
37-
val javadocDir = outDir / 'javadoc
38-
os.makeDir.all(javadocDir)
39-
mill.api.Result.Success(mill.modules.Jvm.createJar(Agg(javadocDir))(outDir))
40-
}
4133
}

mill

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# This is a wrapper script, that automatically download mill from GitHub release pages
44
# You can give the required mill version with MILL_VERSION env variable
55
# If no version is given, it falls back to the value of DEFAULT_MILL_VERSION
6-
DEFAULT_MILL_VERSION=0.9.5
6+
DEFAULT_MILL_VERSION=0.9.5-52-ef6d5d
77

88
set -e
99

requests/src/requests/Requester.scala

+3-3
Original file line numberDiff line numberDiff line change
@@ -191,13 +191,13 @@ case class Requester(verb: String,
191191
case c: HttpsURLConnection =>
192192
if (cert != null) {
193193
c.setSSLSocketFactory(Util.clientCertSocketFactory(cert, verifySslCerts))
194-
if (!verifySslCerts) c.setHostnameVerifier((_: String, _: SSLSession) => true)
194+
if (!verifySslCerts) c.setHostnameVerifier(new HostnameVerifier { def verify(h: String, s: SSLSession) = true })
195195
} else if (sslContext != null) {
196196
c.setSSLSocketFactory(sslContext.getSocketFactory)
197-
if (!verifySslCerts) c.setHostnameVerifier((_: String, _: SSLSession) => true)
197+
if (!verifySslCerts) c.setHostnameVerifier(new HostnameVerifier { def verify(h: String, s: SSLSession) = true })
198198
} else if (!verifySslCerts) {
199199
c.setSSLSocketFactory(Util.noVerifySocketFactory)
200-
c.setHostnameVerifier((_: String, _: SSLSession) => true)
200+
c.setHostnameVerifier(new HostnameVerifier { def verify(h: String, s: SSLSession) = true })
201201
}
202202
c
203203
case c: HttpURLConnection => c

0 commit comments

Comments
 (0)