From bae8c5907c9a2dd340cd10882a653e1d8c2be66e Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Thu, 30 Sep 2021 20:08:25 -0600 Subject: [PATCH 1/2] minor cleanup in build.sbt --- build.sbt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.sbt b/build.sbt index 178432e..4f3c886 100644 --- a/build.sbt +++ b/build.sbt @@ -16,9 +16,9 @@ lazy val collectionContrib = crossProject(JVMPlatform, JSPlatform) versionPolicyIntention := Compatibility.BinaryCompatible, scalaModuleAutomaticModuleName := Some("scala.collection.contrib"), scalacOptions ++= Seq("-opt-warnings", "-language:higherKinds", "-deprecation", "-feature", "-Xfatal-warnings"), - scalacOptions in (Compile, doc) ++= Seq("-implicits", "-groups"), + Compile / doc / scalacOptions ++= Seq("-implicits", "-groups"), testOptions += Tests.Argument(TestFrameworks.JUnit, "-q", "-v", "-s", "-a"), - parallelExecution in Test := false, // why? + Test / parallelExecution := false, // why? libraryDependencies ++= Seq( "junit" % "junit" % "4.13.2" % Test, "com.novocode" % "junit-interface" % "0.11" % Test, @@ -27,7 +27,7 @@ lazy val collectionContrib = crossProject(JVMPlatform, JSPlatform) .jsEnablePlugins(ScalaJSJUnitPlugin) .jsSettings( // Scala.js cannot run forked tests - fork in Test := false + Test / fork := false ) lazy val collectionContribJVM = collectionContrib.jvm From 124b52d9324a5c9aa5b699775dace1580cec26b1 Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Thu, 30 Sep 2021 20:12:26 -0600 Subject: [PATCH 2/2] replace Travis-CI with GitHub Actions and upgrade to sbt-scala-module 3.0.0 context is scala/scala-dev#785 --- .github/workflows/ci.yml | 25 ++++++++++++++++ .github/workflows/release.yml | 21 ++++++++++++++ .travis.yml | 23 --------------- README.md | 1 - build.sbt | 2 ++ build.sh | 54 ----------------------------------- project/plugins.sbt | 8 ++---- 7 files changed, 50 insertions(+), 84 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/release.yml delete mode 100644 .travis.yml delete mode 100755 build.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..b06fd7c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,25 @@ +name: test +on: + push: + branches: + - main + pull_request: +jobs: + test: + strategy: + fail-fast: false + matrix: + java: [8, 11, 17] + scala: [2.13.6] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - uses: coursier/cache-action@v6 + - uses: actions/setup-java@v2 + with: + distribution: adopt + java-version: ${{matrix.java}} + - name: Test + run: sbt ++${{matrix.scala}} test package diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..dc33711 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,21 @@ +name: Release +on: + push: + tags: ["*"] +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - uses: actions/setup-java@v2 + with: + distribution: adopt + java-version: 8 + - run: sbt versionCheck ci-release + env: + PGP_PASSPHRASE: ${{secrets.PGP_PASSPHRASE}} + PGP_SECRET: ${{secrets.PGP_SECRET}} + SONATYPE_PASSWORD: ${{secrets.SONATYPE_PASSWORD}} + SONATYPE_USERNAME: ${{secrets.SONATYPE_USERNAME}} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 73ceb47..0000000 --- a/.travis.yml +++ /dev/null @@ -1,23 +0,0 @@ -version: ~> 1.0 # needed for imports - -import: scala/scala-dev:travis/default.yml - -language: scala - -scala: - - 2.13.6 - -env: - - ADOPTOPENJDK=8 SCALAJS_VERSION= - - ADOPTOPENJDK=8 SCALAJS_VERSION=1.7.0 - - ADOPTOPENJDK=11 SCALAJS_VERSION= - - ADOPTOPENJDK=17 SCALAJS_VERSION= - -install: - - git fetch --tags # get all tags for sbt-dynver - -script: ./build.sh - -notifications: - email: - - seth.tisue@lightbend.com diff --git a/README.md b/README.md index aedd757..1f1998d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ # scala-collection-contrib -[](https://travis-ci.org/scala/scala-collection-contrib) [](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aorg.scala-lang.modules%20a%3Ascala-collection-contrib_2.13) This module provides various additions to the Scala 2.13 standard collections. diff --git a/build.sbt b/build.sbt index 4f3c886..858f215 100644 --- a/build.sbt +++ b/build.sbt @@ -1,3 +1,5 @@ +ThisBuild / scalaVersion := "2.13.6" + lazy val root = project.in(file(".")) .aggregate(collectionContrib.jvm, collectionContrib.js) .settings( diff --git a/build.sh b/build.sh deleted file mode 100755 index db49fa7..0000000 --- a/build.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/bash - -set -e - -# Builds of tagged revisions are published to sonatype staging. - -# Travis runs a build on new revisions and on new tags, so a tagged revision is built twice. -# Builds for a tag have TRAVIS_TAG defined, which we use for identifying tagged builds. - -# sbt-dynver sets the version number from the tag -# sbt-travisci sets the Scala version from the travis job matrix - -# To back-publish an existing release for a new Scala / Scala.js / Scala Native version: -# - check out the tag for the version that needs to be published -# - change `.travis.yml` to adjust the version numbers and trim down the build matrix as necessary -# - commit the changes and tag this new revision with an arbitrary suffix after a hash, e.g., -# `v1.2.3#dotty-0.27` (the suffix is ignored, the version will be `1.2.3`) - -# We release on JDK 8 (for Scala 2.x and Dotty 0.x) -isReleaseJob() { - if [[ "$ADOPTOPENJDK" == "8" ]]; then - true - else - false - fi -} - -if [[ "$SCALAJS_VERSION" == "" ]]; then - projectPrefix="collectionContribJVM/" -else - projectPrefix="collectionContribJS/" -fi - -verPat="[0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9-]+)?" -tagPat="^v$verPat(#.*)?$" - -if [[ "$TRAVIS_TAG" =~ $tagPat ]]; then - releaseTask="ci-release" - if ! isReleaseJob; then - echo "Not releasing on Java $ADOPTOPENJDK with Scala $TRAVIS_SCALA_VERSION" - exit 0 - fi -fi - -# default is +publishSigned; we cross-build with travis jobs, not sbt's crossScalaVersions -export CI_RELEASE="${projectPrefix}publishSigned" -export CI_SNAPSHOT_RELEASE="${projectPrefix}publish" - -# default is sonatypeBundleRelease, which closes and releases the staging repo -# see https://github.com/xerial/sbt-sonatype#commands -# for now, until we're confident in the new release scripts, just close the staging repo. -export CI_SONATYPE_RELEASE="; sonatypePrepare; sonatypeBundleUpload; sonatypeClose" - -sbt clean ${projectPrefix}test ${projectPrefix}publishLocal $releaseTask diff --git a/project/plugins.sbt b/project/plugins.sbt index be182be..02579f9 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,7 +1,3 @@ -val scalaJSVersion = - Option(System.getenv("SCALAJS_VERSION")).filter(_.nonEmpty).getOrElse("1.7.0") - -addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % "2.4.0") - +addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % "3.0.0") addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.1.0") -addSbtPlugin("org.scala-js" % "sbt-scalajs" % scalaJSVersion) +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.7.0")