Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions .github/stale.yml

This file was deleted.

13 changes: 6 additions & 7 deletions .github/workflows/build.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
name: build
name: CI

on:
push:
paths-ignore:
- 'doc/**'
- 'docs/**'
- '*.md'
- '*.yml'
branches:
- master
- release/*

jobs:
scala:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
java: [ '11' ]
java: [ '1.8', '1.11' ]
scala: [
{ version: '2.12.13' },
{ version: '2.12.12' },
Expand All @@ -37,10 +36,10 @@ jobs:
with:
fetch-depth: 0

- name: Set up JDK
uses: actions/setup-java@v1
- name: Set up Scala env
uses: olafurpg/setup-scala@v10
with:
java-version: ${{ matrix.java }}
java-version: adopt@${{ matrix.java }}

- name: run tests
run: sbt ++${{ matrix.scala.version }} test
42 changes: 0 additions & 42 deletions .github/workflows/pr.yml

This file was deleted.

71 changes: 14 additions & 57 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,63 +1,20 @@
name: release

name: Release
on:
workflow_dispatch:
inputs:
version:
description: "The release version"
required: true
branch:
description: "The branch to release from"
required: true

push:
branches: [master]
tags: ["*"]
jobs:
scala:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ '11' ]
scala: [
{ version: '2.12.13' },
{ version: '2.12.12' },
{ version: '2.12.11' },
{ version: '2.12.10' },
{ version: '2.12.9' },
{ version: '2.12.8' },
{ version: '2.13.5' },
{ version: '2.13.4' },
{ version: '2.13.3' },
{ version: '2.13.2' },
{ version: '2.13.1' },
{ version: '2.13.0' }
]
publish:
runs-on: ubuntu-20.04
steps:
- name: checkout the repo
uses: actions/checkout@v2
- uses: actions/checkout@v2.3.4
with:
fetch-depth: 0

- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}

- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v3
with:
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PGP_PASSPHRASE }}

- name: GPG user IDs
run: |
echo "fingerprint: ${{ steps.import_gpg.outputs.fingerprint }}"
echo "keyid: ${{ steps.import_gpg.outputs.keyid }}"
echo "name: ${{ steps.import_gpg.outputs.name }}"
echo "email: ${{ steps.import_gpg.outputs.email }}"

- name: publish release
run: sbt ++${{ matrix.scala.version }} publishSigned
- uses: olafurpg/setup-scala@v10
- uses: olafurpg/setup-gpg@v3
- run: sbt ci-release
env:
RELEASE_VERSION: ${{ github.event.inputs.version }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
142 changes: 67 additions & 75 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,107 +1,99 @@
import sbt._
import sbt.Keys._
import sbtrelease.ReleasePlugin.autoImport._
import sbtcrossproject.CrossProject
import sbtcrossproject.CrossType

val Org = "org.scoverage"
def localSnapshotVersion = "1.4.4-SNAPSHOT"
def isCI = System.getenv("CI") != null

val ScalatestVersion = "3.1.1"

val bin212 = Seq("2.12.13", "2.12.12", "2.12.11", "2.12.10", "2.12.9", "2.12.8")
val bin213 = Seq("2.13.5", "2.13.4", "2.13.3", "2.13.2", "2.13.1", "2.13.0")

val appSettings = Seq(
organization := Org,
scalaVersion := "2.12.13",
inThisBuild(
List(
organization := "org.scoverage",
homepage := Some(url("http://scoverage.org/")),
developers := List(
Developer(
"sksamuel",
"Stephen Samuel",
"sam@sksamuel.com",
url("https://github.com/sksamuel")
),
Developer(
"gslowikowski",
"Grzegorz Slowikowski",
"gslowikowski@gmail.com",
url("https://github.com/gslowikowski")
)
),
licenses := Seq(
"Apache-2.0" -> url("http://www.apache.org/license/LICENSE-2.0")
),
version ~= { dynVer =>
if (isCI) dynVer
else localSnapshotVersion // only for local publishing
},
scalaVersion := bin213.head,
crossScalaVersions := bin212 ++ bin213,
crossVersion := CrossVersion.full,
crossTarget := target.value / s"scala-${scalaVersion.value}",
Test / fork := false,
publishMavenStyle := true,
Test / publishArtifact := false,
Test / parallelExecution := false,
scalacOptions := Seq("-unchecked", "-deprecation", "-feature", "-encoding", "utf8"),
scalacOptions := Seq(
"-unchecked",
"-deprecation",
"-feature",
"-encoding",
"utf8"
),
Global / concurrentRestrictions += Tags.limit(Tags.Test, 1),
publishTo := {
if (isSnapshot.value)
Some("snapshots" at "https://oss.sonatype.org/content/repositories/snapshots")
else
Some("releases" at "https://oss.sonatype.org/service/local/staging/deploy/maven2")
},
libraryDependencies ++= Seq(
"org.scala-lang" % "scala-compiler" % scalaVersion.value % Compile
),
pomExtra := {
<url>https://github.com/scoverage/scalac-scoverage-plugin</url>
<licenses>
<license>
<name>Apache 2</name>
<url>http://www.apache.org/licenses/LICENSE-2.0</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>git@github.com:scoverage/scalac-scoverage-plugin.git</url>
<connection>scm:git@github.com:scoverage/scalac-scoverage-plugin.git</connection>
</scm>
<developers>
<developer>
<id>sksamuel</id>
<name>Stephen Samuel</name>
<url>http://github.com/sksamuel</url>
</developer>
<developer>
<id>gslowikowski</id>
<name>Grzegorz Slowikowski</name>
<url>http://github.com/gslowikowski</url>
</developer>
</developers>
},
pomIncludeRepository := {
_ => false
}
) ++ Seq(
releaseCrossBuild := true,
releasePublishArtifactsAction := PgpKeys.publishSigned.value
)
)
)

lazy val root = Project("scalac-scoverage", file("."))
.settings(name := "scalac-scoverage")
.settings(appSettings: _*)
.settings(publishArtifact := false)
.settings(publishLocal := {})
.aggregate(plugin, runtime.jvm, runtime.js)
.settings(name := "scalac-scoverage")
.settings(publishArtifact := false)
.settings(publishLocal := {})
.aggregate(plugin, runtime.jvm, runtime.js)

lazy val runtime = CrossProject("scalac-scoverage-runtime", file("scalac-scoverage-runtime"))(JVMPlatform, JSPlatform)
.crossType(CrossType.Full)
.withoutSuffixFor(JVMPlatform)
.settings(name := "scalac-scoverage-runtime")
.settings(appSettings: _*)
.settings(
libraryDependencies += "org.scalatest" %%% "scalatest" % ScalatestVersion % Test
)
.jvmSettings(
Test / fork := true
)
.jsSettings(
crossVersion := CrossVersion.fullWith("sjs" + scalaJSVersion.take(1) + "_", ""),
scalaJSStage := FastOptStage
)
lazy val runtime = CrossProject(
"scalac-scoverage-runtime",
file("scalac-scoverage-runtime")
)(JVMPlatform, JSPlatform)
.crossType(CrossType.Full)
.withoutSuffixFor(JVMPlatform)
.settings(name := "scalac-scoverage-runtime")
.settings(
crossTarget := target.value / s"scala-${scalaVersion.value}",
libraryDependencies += "org.scalatest" %%% "scalatest" % ScalatestVersion % Test
)
.jvmSettings(
Test / fork := true
)
.jsSettings(
crossVersion := CrossVersion
.fullWith("sjs" + scalaJSVersion.take(1) + "_", ""),
scalaJSStage := FastOptStage
)

lazy val `scalac-scoverage-runtimeJVM` = runtime.jvm
lazy val `scalac-scoverage-runtimeJS` = runtime.js

lazy val plugin = Project("scalac-scoverage-plugin", file("scalac-scoverage-plugin"))
lazy val plugin =
Project("scalac-scoverage-plugin", file("scalac-scoverage-plugin"))
.dependsOn(`scalac-scoverage-runtimeJVM` % Test)
.settings(name := "scalac-scoverage-plugin")
.settings(appSettings: _*)
.settings(
crossTarget := target.value / s"scala-${scalaVersion.value}",
libraryDependencies ++= Seq(
"org.scala-lang.modules" %% "scala-xml" % "1.2.0",
"org.scalatest" %% "scalatest" % ScalatestVersion % Test
)
)
.settings(
(Test/ unmanagedSourceDirectories) += (Test / sourceDirectory).value / "scala-2.12+"
)

.settings(
(Test / unmanagedSourceDirectories) += (Test / sourceDirectory).value / "scala-2.12+"
)
6 changes: 1 addition & 5 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.0.1")

addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.13")

addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.5.1")

addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.0.0")
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.7")
1 change: 0 additions & 1 deletion version.sbt

This file was deleted.