Skip to content
This repository has been archived by the owner on Aug 13, 2024. It is now read-only.

Commit

Permalink
Migrate CI/CD
Browse files Browse the repository at this point in the history
  • Loading branch information
oguzhanunlu authored and istreeter committed Nov 19, 2021
1 parent 9370e7d commit a12b717
Show file tree
Hide file tree
Showing 7 changed files with 123 additions and 33 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: CD

on:
push:
tags:
- '*'

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

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

- name: Publish common_2.12 to Sonatype
run: |
sbt "project common" clean ci-release
continue-on-error: true
env:
PGP_PASSPHRASE: ${{ secrets.SONA_PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.SONA_PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONA_PASS }}
SONATYPE_USERNAME: ${{ secrets.SONA_USER }}

- name: Publish grpc_2.12 to Sonatype
run: |
sbt "project grpc" clean ci-release
continue-on-error: true
env:
PGP_PASSPHRASE: ${{ secrets.SONA_PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.SONA_PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONA_PASS }}
SONATYPE_USERNAME: ${{ secrets.SONA_USER }}

- name: Publish common_2.13 to Sonatype
run: |
sbt "project common" ++2.13.5! clean ci-release
continue-on-error: true
env:
PGP_PASSPHRASE: ${{ secrets.SONA_PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.SONA_PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONA_PASS }}
SONATYPE_USERNAME: ${{ secrets.SONA_USER }}

- name: Publish grpc_2.13 to Sonatype
run: |
sbt "project grpc" ++2.13.5! clean ci-release
continue-on-error: true
env:
PGP_PASSPHRASE: ${{ secrets.SONA_PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.SONA_PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONA_PASS }}
SONATYPE_USERNAME: ${{ secrets.SONA_USER }}
23 changes: 23 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: CI

on:
push:
branches:
- master
pull_request:

jobs:
ci:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: coursier/cache-action@v5

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

- name: Run tests
run: sbt "project grpc" clean +test
21 changes: 21 additions & 0 deletions .github/workflows/snyk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Snyk

on:
push:
branches: [ master ]

jobs:
snyk:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: coursier/cache-action@v6

- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/scala@master
with:
command: monitor
args: --project-name=fs2-google-pubsub
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
[![Build Status](https://travis-ci.com/permutive/fs2-google-pubsub.svg?branch=CE2)](https://travis-ci.org/permutive/fs2-google-pubsub)
[![Maven Central](https://img.shields.io/maven-central/v/com.permutive/fs2-google-pubsub_2.12.svg)](http://search.maven.org/#search%7Cga%7C1%7Cfs2-google-pubsub)

This repository is a fork. The original repository is at https://github.com/permutive/fs2-google-pubsub.

[Google Cloud Pub/Sub][0] stream-based client built on top of [cats-effect][1], [fs2][2] and [http4s][6].

`fs2-google-pubsub` provides a mix of APIs, depending on the exact module. Consumers are provided as `fs2` streams,
Expand Down
50 changes: 18 additions & 32 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def priorTo2_13(scalaVersion: String): Boolean =
}

lazy val commonSettings = Seq(
organization := "com.permutive",
organization := "com.snowplowanalytics",
scalaVersion := Dependencies.Versions.scala212,
crossScalaVersions := Seq(Dependencies.Versions.scala212, Dependencies.Versions.scala213),
Compile / compile / javacOptions ++= Seq("-source", "1.8", "-target", "1.8"),
Expand Down Expand Up @@ -56,7 +56,7 @@ lazy val commonSettings = Seq(
"-opt-inline-from:com.permutive.**",
"-opt-warnings",
// Lint after expansion so that implicits used in macros are not flagged as unused
"-Ywarn-macros:after",
"-Ywarn-macros:after"
),
scalacOptions ++= {
if (priorTo2_13(scalaVersion.value))
Expand All @@ -70,11 +70,11 @@ lazy val commonSettings = Seq(
"-Ywarn-nullary-unit", // Warn when nullary methods return Unit.
"-Xlint:by-name-right-associative", // By-name parameter of right associative operator.
"-Xlint:unsound-match", // Pattern match may not be typesafe.
"-Xfuture", // Turn on future language features.
"-Xfuture" // Turn on future language features.
)
else
Seq(
"-Ymacro-annotations",
"-Ymacro-annotations"
)
}
)
Expand All @@ -85,7 +85,7 @@ lazy val common = (project in file("fs2-google-pubsub"))
commonSettings,
publishSettings,
libraryDependencies ++= Dependencies.commonDependencies,
libraryDependencies ++= Dependencies.testsDependencies,
libraryDependencies ++= Dependencies.testsDependencies
)

lazy val http = (project in file("fs2-google-pubsub-http"))
Expand All @@ -95,7 +95,7 @@ lazy val http = (project in file("fs2-google-pubsub-http"))
commonSettings,
publishSettings,
libraryDependencies ++= Dependencies.httpDependencies,
libraryDependencies ++= Dependencies.testsDependencies,
libraryDependencies ++= Dependencies.testsDependencies
)

lazy val grpc = (project in file("fs2-google-pubsub-grpc"))
Expand All @@ -105,7 +105,7 @@ lazy val grpc = (project in file("fs2-google-pubsub-grpc"))
commonSettings,
publishSettings,
libraryDependencies ++= Dependencies.grpcDependencies,
libraryDependencies ++= Dependencies.testsDependencies,
libraryDependencies ++= Dependencies.testsDependencies
)

lazy val root = (project in file("."))
Expand All @@ -115,42 +115,28 @@ lazy val root = (project in file("."))
commonSettings,
publishSettings,
publish / skip := true,
crossScalaVersions := Nil
)
.aggregate(
common,
http,
grpc
)

lazy val publishSettings = Seq(
releaseCrossBuild := true,
releaseVcsSign := true,
releasePublishArtifactsAction := PgpKeys.publishSigned.value,
homepage := Some(url("https://github.com/permutive/fs2-google-pubsub")),
licenses := Seq("Apache 2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
publishMavenStyle := true,
lazy val publishSettings = Seq[Setting[_]](
publishArtifact := true,
pomIncludeRepository := { _ => false },
ThisBuild / dynverVTagPrefix := false, // Otherwise git tags required to have v-prefix
organization := "com.snowplowanalytics",
homepage := Some(url("https://snowplowanalytics.com")),
licenses := List("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
scmInfo := Some(ScmInfo(url("https://github.com/snowplow-incubator/fs2-google-pubsub"), "scm:[email protected]:snowplow-incubator/fs2-google-pubsub.git")),
Test / publishArtifact := false,
pomIncludeRepository := { _ =>
false
},
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value)
Some("snapshots".at(nexus + "content/repositories/snapshots"))
else
Some("releases".at(nexus + "service/local/staging/deploy/maven2"))
},
autoAPIMappings := true,
scmInfo := Some(
ScmInfo(
url("https://github.com/permutive/fs2-google-pubsub"),
"scm:git:[email protected]:permutive/fs2-google-pubsub.git"
)
),
developers := List(
Developer("cremboc", "Paulius Imbrasas", "", url("https://github.com/cremboc")),
Developer("TimWSpence", "Tim Spence", "", url("https://github.com/TimWSpence")),
Developer("bastewart", "Ben Stewart", "", url("https://github.com/bastewart")),
Developer("travisbrown", "Travis Brown", "", url("https://twitter.com/travisbrown"))
Developer("travisbrown", "Travis Brown", "", url("https://twitter.com/travisbrown")),
Developer("Snowplow Analytics Ltd", "Snowplow Analytics Ltd", "[email protected]", url("https://snowplowanalytics.com"))
)
)
1 change: 1 addition & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.9.2")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.3")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.8.2")
addSbtPlugin("io.chrisdavenport" % "sbt-mima-version-check" % "0.1.2")
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.7")
1 change: 0 additions & 1 deletion version.sbt

This file was deleted.

0 comments on commit a12b717

Please sign in to comment.