Skip to content

Commit ba392b7

Browse files
committed
Update build
1 parent 0d467cf commit ba392b7

File tree

11 files changed

+125
-97
lines changed

11 files changed

+125
-97
lines changed

.github/release-drafter.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
template: |
2+
## What’s Changed
3+
4+
$CHANGES

.github/workflows/ci.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: CI
2+
on:
3+
pull_request:
4+
branches: ['*']
5+
push:
6+
branches: ['*']
7+
tags: [v*]
8+
jobs:
9+
ci:
10+
# run on external PRs, but not on internal PRs since those will be run by push to branch
11+
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
12+
runs-on: ubuntu-20.04
13+
env:
14+
STTP_NATIVE: 1
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v2
18+
- name: Set up JDK 11
19+
uses: actions/setup-java@v1
20+
with:
21+
java-version: 11
22+
- name: Cache sbt
23+
uses: actions/cache@v2
24+
with:
25+
path: |
26+
~/.sbt
27+
~/.ivy2/cache
28+
~/.coursier
29+
key: sbt-cache-${{ runner.os }}-${{ hashFiles('project/build.properties') }}
30+
- name: Install libidn11-dev
31+
run: sudo apt-get install libidn11-dev
32+
- name: Compile
33+
run: sbt -v compile
34+
- name: Test
35+
run: sbt -v test
36+
- name: Cleanup
37+
run: |
38+
rm -rf "$HOME/.ivy2/local" || true
39+
find $HOME/.ivy2/cache -name "ivydata-*.properties" -delete || true
40+
find $HOME/.ivy2/cache -name "*-LM-SNAPSHOT*" -delete || true
41+
find $HOME/.cache/coursier/v1 -name "ivydata-*.properties" -delete || true
42+
find $HOME/.sbt -name "*.lock" -delete || true
43+
44+
publish:
45+
name: Publish release
46+
needs: [ci]
47+
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v'))
48+
runs-on: ubuntu-20.04
49+
env:
50+
STTP_NATIVE: 1
51+
steps:
52+
- name: Checkout
53+
uses: actions/checkout@v2
54+
- name: Set up JDK 11
55+
uses: actions/setup-java@v1
56+
with:
57+
java-version: 11
58+
- name: Cache sbt
59+
uses: actions/cache@v2
60+
with:
61+
path: |
62+
~/.sbt
63+
~/.ivy2/cache
64+
~/.coursier
65+
key: sbt-cache-${{ runner.os }}-${{ hashFiles('project/build.properties') }}
66+
- name: Compile
67+
run: sbt compile
68+
- name: Publish artifacts
69+
run: sbt ci-release
70+
env:
71+
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
72+
PGP_SECRET: ${{ secrets.PGP_SECRET }}
73+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
74+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
75+
- name: Extract version from commit message
76+
run: |
77+
version=${GITHUB_REF/refs\/tags\/v/}
78+
echo "VERSION=$version" >> $GITHUB_ENV
79+
env:
80+
COMMIT_MSG: ${{ github.event.head_commit.message }}
81+
- name: Publish release notes
82+
uses: release-drafter/release-drafter@v5
83+
with:
84+
config-name: release-drafter.yml
85+
publish: true
86+
name: "v${{ env.VERSION }}"
87+
tag: "v${{ env.VERSION }}"
88+
version: "v${{ env.VERSION }}"
89+
env:
90+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
91+
- name: Cleanup
92+
run: |
93+
rm -rf "$HOME/.ivy2/local" || true
94+
find $HOME/.ivy2/cache -name "ivydata-*.properties" -delete || true
95+
find $HOME/.ivy2/cache -name "*-LM-SNAPSHOT*" -delete || true
96+
find $HOME/.cache/coursier/v1 -name "ivydata-*.properties" -delete || true
97+
find $HOME/.sbt -name "*.lock" -delete || true

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,5 @@ lowered.hnir
2929
.bloop/
3030
.metals/
3131
project/metals.sbt
32+
33+
.bsp

.mergify.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ pull_request_rules:
66
- name: automatic merge for scala-steward pull requests affecting build.sbt
77
conditions:
88
- author=scala-steward
9-
- status-success=continuous-integration/travis-ci/pr
9+
- check-success=ci
1010
- "#files=1"
1111
- files=build.sbt
1212
actions:
@@ -15,7 +15,7 @@ pull_request_rules:
1515
- name: automatic merge for scala-steward pull requests affecting project plugins.sbt
1616
conditions:
1717
- author=scala-steward
18-
- status-success=continuous-integration/travis-ci/pr
18+
- check-success=ci
1919
- "#files=1"
2020
- files=project/plugins.sbt
2121
actions:
@@ -24,15 +24,15 @@ pull_request_rules:
2424
- name: semi-automatic merge for scala-steward pull requests
2525
conditions:
2626
- author=scala-steward
27-
- status-success=continuous-integration/travis-ci/pr
27+
- check-success=ci
2828
- "#approved-reviews-by>=1"
2929
actions:
3030
merge:
3131
method: merge
3232
- name: automatic merge for scala-steward pull requests affecting project build.properties
3333
conditions:
3434
- author=scala-steward
35-
- status-success=continuous-integration/travis-ci/pr
35+
- check-success=ci
3636
- "#files=1"
3737
- files=project/build.properties
3838
actions:
@@ -41,7 +41,7 @@ pull_request_rules:
4141
- name: automatic merge for scala-steward pull requests affecting .scalafmt.conf
4242
conditions:
4343
- author=scala-steward
44-
- status-success=continuous-integration/travis-ci/pr
44+
- check-success=ci
4545
- "#files=1"
4646
- files=.scalafmt.conf
4747
actions:

.travis.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
![sttp-shared](https://github.com/softwaremill/sttp-shared/raw/master/banner.png)
22

3-
[![Build Status](https://travis-ci.org/softwaremill/sttp-shared.svg?branch=master)](https://travis-ci.org/softwaremill/sttp-shared)
3+
[![Join the chat at https://gitter.im/softwaremill/sttp](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/softwaremill/sttp)
4+
[![CI](https://github.com/softwaremill/sttp-shared/workflows/CI/badge.svg)](https://github.com/softwaremill/sttp-shared/actions?query=workflow%3A%22CI%22)
45
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.softwaremill.sttp.shared/core_2.12/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.softwaremill.sttp.shared/core_2.12)
56

67
sttp is a family of Scala HTTP-related projects, and currently includes:

build.sbt

Lines changed: 10 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
1-
import com.softwaremill.Publish.Release.updateVersionInDocs
2-
import sbtrelease.ReleasePlugin.autoImport._
3-
import sbtrelease.ReleaseStateTransformations._
4-
// run JS tests inside Chrome, due to jsdom not supporting fetch
51
import com.softwaremill.SbtSoftwareMillBrowserTestJS._
62

73
val scala2_11 = "2.11.12"
84
val scala2_12 = "2.12.11"
95
val scala2_13 = "2.13.4"
106
val scala2 = List(scala2_11, scala2_12, scala2_13)
11-
val dotty = "0.27.0-RC1"
12-
val scala3 = List(dotty, "3.0.0-M1")
7+
val scala3 = List("3.0.0-M1", "3.0.0-M2")
138

14-
val sttpModelVersion = "1.2.0-RC6"
9+
val sttpModelVersion = "1.2.0-RC8"
1510

16-
def scalaTestVersion(scalaVersion: String): String = if (scalaVersion == dotty) "3.2.2" else "3.2.3"
11+
val scalaTestVersion = "3.2.3"
1712
val scalaNativeTestInterfaceVersion = "0.4.0-M2"
1813
val zioVersion = "1.0.3"
1914
val fs2Version: Option[(Long, Long)] => String = {
@@ -28,28 +23,6 @@ def dependenciesFor(version: String)(deps: (Option[(Long, Long)] => ModuleID)*):
2823

2924
val commonSettings = commonSmlBuildSettings ++ ossPublishSettings ++ Seq(
3025
organization := "com.softwaremill.sttp.shared",
31-
scmInfo := Some(
32-
ScmInfo(url("https://github.com/softwaremill/sttp-shared"), "scm:[email protected]:softwaremill/sttp-shared.git")
33-
),
34-
// cross-release doesn't work when subprojects have different cross versions
35-
// work-around from https://github.com/sbt/sbt-release/issues/214
36-
releaseCrossBuild := false,
37-
releaseProcess := Seq(
38-
checkSnapshotDependencies,
39-
inquireVersions,
40-
// publishing locally so that the pgp password prompt is displayed early
41-
// in the process
42-
releaseStepCommandAndRemaining("publishLocalSigned"),
43-
releaseStepCommandAndRemaining("clean"),
44-
releaseStepCommandAndRemaining("test"),
45-
setReleaseVersion,
46-
updateVersionInDocs(organization.value),
47-
commitReleaseVersion,
48-
tagRelease,
49-
releaseStepCommandAndRemaining("publishSigned"),
50-
releaseStepCommand("sonatypeBundleRelease"),
51-
pushChanges
52-
),
5326
// doc generation is broken in dotty
5427
sources in (Compile, doc) := {
5528
val scalaV = scalaVersion.value
@@ -67,28 +40,15 @@ val commonJvmSettings = commonSettings ++ Seq(
6740
},
6841
ideSkipProject := (scalaVersion.value != scala2_13),
6942
libraryDependencies ++= Seq(
70-
"org.scalatest" %% "scalatest" % scalaTestVersion(scalaVersion.value) % Test
43+
"org.scalatest" %% "scalatest" % scalaTestVersion % Test
7144
)
7245
)
7346

7447
val commonJsSettings = commonSettings ++ Seq(
75-
// https://github.com/scalaz/scalaz/pull/1734#issuecomment-385627061
76-
scalaJSLinkerConfig ~= {
77-
_.withBatchMode(System.getenv("CONTINUOUS_INTEGRATION") == "true")
78-
},
79-
scalacOptions in Compile ++= {
80-
if (isSnapshot.value) Seq.empty
81-
else
82-
Seq {
83-
val dir = project.base.toURI.toString.replaceFirst("[^/]+/?$", "")
84-
val url = "https://raw.githubusercontent.com/softwaremill/sttp-shared"
85-
s"-P:scalajs:mapSourceURI:$dir->$url/v${version.value}/"
86-
}
87-
},
8848
ideSkipProject := true,
8949
libraryDependencies ++= Seq(
9050
"org.scala-js" %%% "scalajs-dom" % "1.1.0",
91-
"org.scalatest" %%% "scalatest" % scalaTestVersion(scalaVersion.value) % Test
51+
"org.scalatest" %%% "scalatest" % scalaTestVersion % Test
9252
)
9353
)
9454

@@ -97,7 +57,7 @@ val commonNativeSettings = commonSettings ++ Seq(
9757
ideSkipProject := true,
9858
libraryDependencies ++= Seq(
9959
"org.scala-native" %%% "test-interface" % scalaNativeTestInterfaceVersion,
100-
"org.scalatest" %%% "scalatest" % scalaTestVersion(scalaVersion.value) % Test
60+
"org.scalatest" %%% "scalatest" % scalaTestVersion % Test
10161
)
10262
)
10363

@@ -134,7 +94,7 @@ lazy val core = (projectMatrix in file("core"))
13494
)
13595
.jsPlatform(
13696
scalaVersions = scala2,
137-
settings = commonJsSettings ++ browserTestSettings
97+
settings = commonJsSettings ++ browserChromeTestSettings
13898
)
13999
.nativePlatform(
140100
scalaVersions = List(scala2_11),
@@ -152,7 +112,7 @@ lazy val ws = (projectMatrix in file("ws"))
152112
)
153113
.jsPlatform(
154114
scalaVersions = scala2,
155-
settings = commonJsSettings ++ browserTestSettings
115+
settings = commonJsSettings ++ browserChromeTestSettings
156116
)
157117
.nativePlatform(
158118
scalaVersions = List(scala2_11),
@@ -196,7 +156,7 @@ lazy val monix = (projectMatrix in file("monix"))
196156
)
197157
.jsPlatform(
198158
scalaVersions = List(scala2_12, scala2_13),
199-
settings = commonJsSettings ++ browserTestSettings
159+
settings = commonJsSettings ++ browserChromeTestSettings
200160
)
201161
.dependsOn(core)
202162

@@ -206,7 +166,7 @@ lazy val zio = (projectMatrix in file("zio"))
206166
libraryDependencies ++= Seq("dev.zio" %% "zio-streams" % zioVersion, "dev.zio" %% "zio" % zioVersion)
207167
)
208168
.jvmPlatform(
209-
scalaVersions = scala2 ++ List(dotty),
169+
scalaVersions = scala2,
210170
settings = commonJvmSettings
211171
)
212172
.dependsOn(core)

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=1.4.4
1+
sbt.version=1.4.5

project/plugins.sbt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
libraryDependencies += "org.scala-js" %% "scalajs-env-selenium" % "1.1.0"
22
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.3.1")
33
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.0-M2")
4-
addSbtPlugin("com.eed3si9n" % "sbt-projectmatrix" % "0.6.0")
4+
addSbtPlugin("com.eed3si9n" % "sbt-projectmatrix" % "0.7.0")
55

6-
val sbtSoftwareMillVersion = "1.9.15"
6+
val sbtSoftwareMillVersion = "2.0.2"
77
addSbtPlugin("com.softwaremill.sbt-softwaremill" % "sbt-softwaremill-common" % sbtSoftwareMillVersion)
88
addSbtPlugin("com.softwaremill.sbt-softwaremill" % "sbt-softwaremill-publish" % sbtSoftwareMillVersion)
99
addSbtPlugin("com.softwaremill.sbt-softwaremill" % "sbt-softwaremill-browser-test-js" % sbtSoftwareMillVersion)
1010

11-
addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.4.6")
11+
addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.5.0")
1212

1313
addSbtPlugin("org.jetbrains" % "sbt-ide-settings" % "1.1.0")

project/travis_setup.sh

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)