Skip to content

Commit

Permalink
Merge 11b6dc2 into ec218ff
Browse files Browse the repository at this point in the history
  • Loading branch information
oguzhanunlu committed Mar 4, 2022
2 parents ec218ff + 11b6dc2 commit 0c00e96
Show file tree
Hide file tree
Showing 43 changed files with 231 additions and 173 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
@@ -0,0 +1,34 @@
name: CI

on:
push:
branches:
- master
- develop
pull_request:

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: coursier/cache-action@v6

- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11

- name: Check Scala formatting
run: sbt scalafmtCheckAll scalafmtSbtCheck

- name: Run tests with coverage
run: sbt clean coverage +test

- name: Check assets can be published
run: sbt +publishLocal

- name: Submit coveralls data
run: sbt coverageReport coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31 changes: 31 additions & 0 deletions .github/workflows/release.yml
@@ -0,0 +1,31 @@
name: release

on:
push:
tags:
- '*'

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: coursier/cache-action@v6

- name: Make site
run: sbt makeSite

- name: Publish ScalaDoc
uses: JamesIves/github-pages-deploy-action@v4.2.5
with:
branch: gh-pages
folder: target/site
clean: false

- name: Deploy to Maven Central
run: sbt ci-release
env:
PGP_PASSPHRASE: ${{ secrets.SONA_PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.SONA_PGP_SECRET }}
SONATYPE_USERNAME: ${{ secrets.SONA_USER }}
SONATYPE_PASSWORD: ${{ secrets.SONA_PASS }}
20 changes: 20 additions & 0 deletions .github/workflows/snyk.yml
@@ -0,0 +1,20 @@
name: Snyk

on:
push:
branches: [ master ]

jobs:
security:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/scala@master
with:
command: monitor
args: --project-name=scala-weather
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

24 changes: 0 additions & 24 deletions .travis/deploy.sh

This file was deleted.

11 changes: 11 additions & 0 deletions CHANGELOG
@@ -1,3 +1,14 @@
Version 2.0.0 (2022-03-03)
--------------------------
Add cross-compilation for Scala 2.13 (#139)
Bump circe to 0.14.1 (#140)
Bump scala-lru-map to 0.6.0 (#138)
Bump Javac to 11 (#137)
Migrate to GitHub Actions (#135)
Extend copyright to 2022 (#134)
Bump Scala to 2.12.15 (#133)
Bump SBT to 1.6.2 (#132)

Version 1.0.0 (2020-09-02)
--------------------------
Reformat code (#128)
Expand Down
30 changes: 17 additions & 13 deletions README.md
@@ -1,8 +1,9 @@
# Scala Weather

[![Build Status][travis-image]][travis] [![Maven Central][maven-badge]][maven-link] [![License][license-image]][license]
[![Join the chat at https://gitter.im/snowplow/scala-weather](https://badges.gitter.im/snowplow/scala-weather.svg)](https://gitter.im/snowplow/scala-weather?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![codecov](https://codecov.io/gh/snowplow/scala-weather/branch/master/graph/badge.svg)](https://codecov.io/gh/snowplow/scala-weather)
[![Build Status][ci-image]][ci]
[![Maven Central][release-image]][releases]
[![Coverage Status][coveralls-image]][coveralls]
[![License][license-image]][license]

## Overview

Expand All @@ -19,12 +20,12 @@ We provide caching and basic clients for both providers - `OwmClient` and `OwmCa

## Installation

The latest version of Scala Weather is 0.5.0, which is built against Scala 2.12.x.
The latest version of Scala Weather is 2.0.0, which is cross-built against Scala 2.12 & 2.13.

If you're using SBT, add the following lines to your build file:

```scala
libraryDependencies += "com.snowplowanalytics" %% "scala-weather" % "0.5.0"
libraryDependencies += "com.snowplowanalytics" %% "scala-weather" % "2.0.0"
```

## Guide
Expand Down Expand Up @@ -210,7 +211,7 @@ action.unsafeRunSync()

## Copyright and license

Scala Weather is copyright 2015-2019 Snowplow Analytics Ltd.
Scala Weather is copyright 2015-2022 Snowplow Analytics Ltd.

Licensed under the **[Apache License, Version 2.0][license]** (the "License");
you may not use this software except in compliance with the License.
Expand All @@ -226,18 +227,21 @@ limitations under the License.
[darksky]: https://darksky.net
[darkskydev]: https://darksky.net/dev
[lru]: https://en.wikipedia.org/wiki/Cache_algorithms#LRU
[history-plan]: http://openweathermap.org/price
[owm-signup]: http://home.openweathermap.org/users/sign_up
[history-plan]: https://openweathermap.org/price
[owm-signup]: https://home.openweathermap.org/users/sign_up

[snowplow]: http://snowplowanalytics.com
[snowplow]: https://snowplowanalytics.com
[snowplow-repo]: https://github.com/snowplow/snowplow
[weather-enrichment]: https://github.com/snowplow/snowplow/wiki/Weather-enrichment

[travis]: https://travis-ci.org/snowplow/scala-weather
[travis-image]: https://travis-ci.org/snowplow/scala-weather.png?branch=master
[coveralls]: https://coveralls.io/github/snowplow/scala-weather?branch=master
[coveralls-image]: https://coveralls.io/repos/github/snowplow/scala-weather/badge.svg?branch=master

[maven-badge]: https://maven-badges.herokuapp.com/maven-central/com.snowplowanalytics/scala-weather_2.12/badge.svg
[maven-link]: https://maven-badges.herokuapp.com/maven-central/com.snowplowanalytics/scala-weather_2.12
[ci]: https://github.com/snowplow/scala-weather/actions?query=workflow%3ACI
[ci-image]: https://github.com/snowplow/scala-weather/workflows/CI/badge.svg

[releases]: https://maven-badges.herokuapp.com/maven-central/com.snowplowanalytics/scala-weather_2.12
[release-image]: https://img.shields.io/maven-central/v/com.snowplowanalytics/scala-weather_2.12.svg

[license-image]: http://img.shields.io/badge/license-Apache--2-blue.svg?style=flat
[license]: http://www.apache.org/licenses/LICENSE-2.0
22 changes: 17 additions & 5 deletions build.sbt
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2019 Snowplow Analytics Ltd. All rights reserved.
* Copyright (c) 2015-2022 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
Expand All @@ -13,18 +13,29 @@

lazy val root = project
.in(file("."))
.enablePlugins(ScalaUnidocPlugin, GhpagesPlugin)
.settings(
name := "scala-weather",
organization := "com.snowplowanalytics",
version := "1.0.0",
description := "High-performance Scala library for performing current and historical weather lookups",
scalaVersion := "2.12.8",
scalaVersion := "2.13.8",
crossScalaVersions := Seq("2.12.15", "2.13.8"),
javacOptions := BuildSettings.javaCompilerOptions,
shellPrompt := { _ =>
name.value + "> "
},
addCompilerPlugin(("org.scalamacros" % "paradise" % "2.1.1").cross(CrossVersion.full))
libraryDependencies ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, n)) if n <= 12 =>
List(compilerPlugin(("org.scalamacros" % "paradise" % "2.1.1").cross(CrossVersion.full)))
case _ => Nil
}
},
Compile / scalacOptions ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, n)) if n <= 12 => Nil
case _ => List("-Ymacro-annotations")
}
}
)
.settings(BuildSettings.publishSettings)
.settings(BuildSettings.docsSettings)
Expand All @@ -40,3 +51,4 @@ lazy val root = project
Dependencies.Libraries.specsScalaCheck
)
)
.enablePlugins(SiteScaladocPlugin, PreprocessPlugin)
49 changes: 17 additions & 32 deletions project/BuildSettings.scala
Expand Up @@ -12,50 +12,35 @@
*/
import sbt._
import Keys._

// Bintray plugin
import bintray.BintrayPlugin._
import bintray.BintrayKeys._
import com.typesafe.sbt.site.SiteScaladocPlugin.autoImport.SiteScaladoc
import sbtdynver.DynVerPlugin.autoImport.dynverVTagPrefix

// Docs
import sbtunidoc.ScalaUnidocPlugin.autoImport._
import com.typesafe.sbt.site.SitePlugin.autoImport.siteSubdirName
import com.typesafe.sbt.site.SitePlugin.autoImport._
import com.typesafe.sbt.SbtGit.GitKeys._

object BuildSettings {

lazy val javaCompilerOptions = Seq(
"-source",
"1.8",
"-target",
"1.8"
)
lazy val javaCompilerOptions = Seq("-source", "11", "-target", "11")

lazy val publishSettings = bintraySettings ++ Seq(
publishMavenStyle := true,
lazy val publishSettings = Seq[Setting[_]](
publishArtifact := true,
publishArtifact in Test := false,
licenses += ("Apache-2.0", url("http://www.apache.org/licenses/LICENSE-2.0.html")),
bintrayOrganization := Some("snowplow"),
bintrayRepository := "snowplow-maven",
Test / publishArtifact := false,
pomIncludeRepository := { _ => false },
homepage := Some(url("http://snowplowanalytics.com")),
scmInfo := Some(
ScmInfo(url("https://github.com/snowplow/scala-weather"), "scm:git@github.com:snowplow/scala-weather.git")
),
pomExtra := (<developers>
<developer>
<name>Snowplow Analytics Ltd</name>
<email>support@snowplowanalytics.com</email>
<organization>Snowplow Analytics Ltd</organization>
<organizationUrl>http://snowplowanalytics.com</organizationUrl>
</developer>
</developers>)
licenses += ("Apache-2.0", url("http://www.apache.org/licenses/LICENSE-2.0.html")),
ThisBuild / dynverVTagPrefix := false, // Otherwise git tags required to have v-prefix
developers := List(
Developer(
"Snowplow Analytics Ltd",
"Snowplow Analytics Ltd",
"support@snowplowanalytics.com",
url("https://snowplowanalytics.com")
)
)
)

lazy val docsSettings = Seq(
addMappingsToSiteDir(mappings in (ScalaUnidoc, packageDoc), siteSubdirName in ScalaUnidoc),
gitRemoteRepo := "https://github.com/snowplow/scala-weather.git",
siteSubdirName := ""
SiteScaladoc / siteSubdirName := s"${version.value}"
)
}
8 changes: 4 additions & 4 deletions project/Dependencies.scala
Expand Up @@ -15,12 +15,12 @@ import sbt._
object Dependencies {

object V {
val circe = "0.13.0"
val scalaj = "2.4.1"
val lruMap = "0.5.0"
val circe = "0.14.1"
val scalaj = "2.4.2"
val lruMap = "0.6.0"

// Tests
val specs2 = "4.3.5"
val specs2 = "4.13.2"
}

object Libraries {
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
@@ -1 +1 @@
sbt.version=1.2.8
sbt.version=1.6.2
13 changes: 6 additions & 7 deletions project/plugins.sbt
@@ -1,7 +1,6 @@
addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.4")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.2")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1")
addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.3.2")
addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % "0.4.2")
addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.6.2")
addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.5")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.2")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.9.3")
addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.3.1")
addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.3.2")
addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.22")
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.7")
2 changes: 1 addition & 1 deletion src/main/scala/com.snowplowanalytics/weather/Cache.scala
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2019 Snowplow Analytics Ltd. All rights reserved.
* Copyright (c) 2015-2022 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2019 Snowplow Analytics Ltd. All rights reserved.
* Copyright (c) 2015-2022 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/com.snowplowanalytics/weather/errors.scala
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2019 Snowplow Analytics Ltd. All rights reserved.
* Copyright (c) 2015-2022 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
Expand Down

0 comments on commit 0c00e96

Please sign in to comment.