Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use github actions for CI and release #375

Merged
3 commits merged into from
May 22, 2020
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: 16 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name-template: 'v$NEXT_PATCH_VERSION'
tag-template: 'v$NEXT_PATCH_VERSION'
template: |
# What's Changed
$CHANGES
categories:
- title: 'New'
label: 'type: feature'
- title: 'Bug Fixes'
label: 'type: bug'
- title: 'Maintenance'
label: 'type: maintenance'
- title: 'Documentation'
label: 'type: docs'
- title: 'Dependency Updates'
label: 'type: dependencies'
29 changes: 0 additions & 29 deletions .github/workflows/create-release.yml

This file was deleted.

16 changes: 16 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Release Drafter

on:
push:
# branches to consider in the event; optional, defaults to all
branches:
- master

jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Release
on:
push:
branches: [master]
tags: ["*"]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: olafurpg/setup-scala@v7
- uses: olafurpg/setup-gpg@v2
- name: Cache dependencies
uses: actions/cache@v1
with:
path: ~/.cache/coursier/v1
key: ${{ runner.os }}-coursier-${{ hashFiles('build.sbt') }}-${{ hashFiles('project/*.scala') }}
restore-keys: ${{ runner.os }}-coursier-
- name: Cache .sbt
uses: actions/cache@v1
with:
path: ~/.sbt
key: ${{ runner.os }}-sbt-${{ hashFiles('build.sbt') }}-${{ hashFiles('project/*.scala') }}
restore-keys: ${{ runner.os }}-sbt-
- name: Publish
run: |
csbt ci-release
SCALAJS_VERSION=0.6.33 csbt ci-release
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
32 changes: 32 additions & 0 deletions .github/workflows/scala.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: build

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: olafurpg/setup-scala@v7
with:
java-version: 1.8
- name: Cache dependencies
uses: actions/cache@v1
with:
path: ~/.cache/coursier/v1
key: ${{ runner.os }}-coursier-${{ hashFiles('build.sbt') }}-${{ hashFiles('project/*.scala') }}
restore-keys: ${{ runner.os }}-coursier-
- name: Cache .sbt
uses: actions/cache@v1
with:
path: ~/.sbt
key: ${{ runner.os }}-sbt-${{ hashFiles('build.sbt') }}-${{ hashFiles('project/*.scala') }}
restore-keys: ${{ runner.os }}-sbt-
- name: Run tests
run: |
csbt +squantsJVM/compile +squantsJS/compile +squantsJS/fastOptJS
csbt squantsNative/compile
csbt +squantsJVM/test +squantsJS/test
SCALAJS_VERSION=0.6.33 csbt clean +squantsJS/test
45 changes: 0 additions & 45 deletions .travis.yml

This file was deleted.

20 changes: 19 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,22 @@ Global / onChangedBuildSource := ReloadOnSourceChanges

ThisBuild / turbo := true

val customScalaJSVersion = Option(System.getenv("SCALAJS_VERSION"))

inThisBuild(List(
organization := "org.typelevel",
homepage := Some(url("http://www.squants.com/")),
licenses := Seq("Apache 2.0" -> url("http://www.opensource.org/licenses/Apache-2.0")),
developers := List(
Developer(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this point, I don't think I should be listed as the only dev. Others have been contributing so much more. I'd say we should either add others to this list or perhaps drop it all together (which I think is the general recommendation).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I may do that in another PR which can be used to verify the release process

"garyKeorkunian",
"Gary Keorkunian",
"unknown",
url("http://www.linkedin.com/in/garykeorkunian")
)
)
))

lazy val squants =
crossProject(JSPlatform, JVMPlatform, NativePlatform)
.crossType(CrossType.Full)
Expand All @@ -25,7 +41,8 @@ lazy val squants =
scalacOptions in Tut --= Seq("-Ywarn-unused-import", "-Ywarn-unused:imports"),
tutTargetDirectory := file("."),
tutSourceDirectory := file("shared") / "src" / "main" / "tut",
parallelExecution in Test := false
parallelExecution in Test := false,
skip.in(publish) := customScalaJSVersion.isDefined
)
.jvmSettings(Tests.defaultSettings: _*)
.jsSettings(
Expand All @@ -36,6 +53,7 @@ lazy val squants =
)
.jsSettings(Tests.defaultSettings: _*)
.nativeSettings(
skip in publish := true,
sources in (Compile, doc) := List(), // Can't build docs in native
sources in (Compile, test) := List() // Can't yet compile in native
)
Expand Down
49 changes: 7 additions & 42 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import com.typesafe.sbt.osgi.SbtOsgi
import com.typesafe.sbt.osgi.SbtOsgi.autoImport._

object Versions {
val Squants = "1.6.0"
val Scala = "2.11.12" // Don't use 2.12 yet to avoid troubles with native
val scalaJSVersion =
Option(System.getenv("SCALAJS_VERSION")).getOrElse("0.6.33")
Expand All @@ -33,16 +32,8 @@ object Resolvers {

object Project {
val defaultSettings = Seq(
organization in ThisBuild := "org.typelevel",

name := "Squants",

version in ThisBuild := Versions.Squants,

licenses := Seq("Apache 2.0" -> url("http://www.opensource.org/licenses/Apache-2.0")),

homepage := Some(url("http://www.squants.com/")),

autoAPIMappings := true,

resolvers ++= Seq(
Expand Down Expand Up @@ -96,44 +87,18 @@ object Compiler {

object Publish {
val defaultSettings = Seq(
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")
},

publishMavenStyle := true,

publishArtifact in Test := false,

pomIncludeRepository := { _ => false },

pomExtra := <scm>
<url>[email protected]:typelevel/squants.git</url>
<connection>scm:git:[email protected]:typelevel/squants.git</connection>
</scm>
<developers>
<developer>
<id>garyKeorkunian</id>
<name>Gary Keorkunian</name>
<url>http://www.linkedin.com/in/garykeorkunian</url>
</developer>
</developers>
publishArtifact in Test := false
)
}

object Tests {
val defaultSettings =
if (Versions.scalaJSVersion.startsWith("0.6")) {
Seq(
libraryDependencies ++=
Dependencies.scalaTest.value ++
Dependencies.scalaCheck.value ++
Dependencies.json4s.value
)
} else Seq.empty
Seq(
libraryDependencies ++=
Dependencies.scalaTest.value ++
Dependencies.scalaCheck.value ++
Dependencies.json4s.value
)
}

object Formatting {
Expand Down
8 changes: 3 additions & 5 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.0.0")
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.0.0")
val scalaJSVersion =
Option(System.getenv("SCALAJS_VERSION")).getOrElse("0.6.33")
Option(System.getenv("SCALAJS_VERSION")).getOrElse("1.1.0")

addSbtPlugin("org.scala-js" % "sbt-scalajs" % scalaJSVersion)
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.3.9")
Expand All @@ -10,8 +10,6 @@ addSbtPlugin("org.scalariform" % "sbt-scalariform" % "1.8.3")

addSbtPlugin("com.typesafe.sbt" % "sbt-osgi" % "0.9.5")

addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.2")

addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.0.1")

addSbtPlugin("org.tpolecat" % "tut-plugin" % "0.6.13")

addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.3")