From 2c18208cc82b41616ce87391db981e5f64e9e44f Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Tue, 31 Aug 2021 12:56:22 -0400 Subject: [PATCH 1/6] add GitHub Actions, drop Travis-CI references scala/scala-dev#785 --- .github/workflows/ci.yml | 23 ++++++++++++++++ .github/workflows/release.yml | 21 +++++++++++++++ .travis.yml | 19 ------------- build.sbt | 3 +++ build.sh | 51 ----------------------------------- project/plugins.sbt | 2 +- 6 files changed, 48 insertions(+), 71 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 00000000..75f526a6 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,23 @@ +name: test +on: + push: + branches: + - main + pull_request: +jobs: + test: + strategy: + fail-fast: false + matrix: + java: [8, 11, 17-ea] + scala: [2.13.6, 3.0.1] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: coursier/cache-action@v6 + - uses: actions/setup-java@v2 + with: + distribution: adopt + java-version: ${{matrix.java}} + - name: Test + run: sbt ++${{matrix.scala}} test core/headerCheck package diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..dc337111 --- /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 a27e91a0..00000000 --- a/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -version: ~> 1.0 # needed for imports - -import: scala/scala-dev:travis/default.yml - -language: scala - -scala: - - 3.0.0 - - 2.13.6 - -env: - - ADOPTOPENJDK=8 - - ADOPTOPENJDK=11 - - ADOPTOPENJDK=17 - -install: - - git fetch --tags # get all tags for sbt-dynver - -script: ./build.sh diff --git a/build.sbt b/build.sbt index 79b3402d..3853f608 100644 --- a/build.sbt +++ b/build.sbt @@ -1,3 +1,6 @@ +ThisBuild / crossScalaVersions := Seq("2.13.6", "3.0.1") +ThisBuild / scalaVersion := (ThisBuild / crossScalaVersions).value.head + Global / cancelable := true publish / skip := true // in root diff --git a/build.sh b/build.sh deleted file mode 100755 index 45d3925e..00000000 --- a/build.sh +++ /dev/null @@ -1,51 +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 3.x). -isReleaseJob() { - if [[ "$ADOPTOPENJDK" == "8" ]]; then - true - else - false - fi -} - -projectPrefix="" - -verPat="[0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9-]+)?" -tagPat="^v$verPat(#.*)?$" - -if [[ "$TRAVIS_TAG" =~ $tagPat ]]; then - versionCheckTask="versionCheck" - 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 core/headerCheck ${projectPrefix}publishLocal $versionCheckTask $releaseTask diff --git a/project/plugins.sbt b/project/plugins.sbt index 0401cc36..a668f722 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1 +1 @@ -addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % "2.4.0") +addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % "3.0.0") From daf5e57fc31c418e6af917864874674035e1a8b4 Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Thu, 9 Sep 2021 17:06:54 -0500 Subject: [PATCH 2/6] use fetch-depth, as per advice from Julien --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 75f526a6..ced4eeb6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,6 +14,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + with: + fetch-depth: 0 - uses: coursier/cache-action@v6 - uses: actions/setup-java@v2 with: From 7521914d33aecf2beaddf3594a91b18b075bf30f Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Thu, 9 Sep 2021 17:11:29 -0500 Subject: [PATCH 3/6] Scala 3.0.2 (was 3.0.1) --- .github/workflows/ci.yml | 2 +- build.sbt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ced4eeb6..1eec4537 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: fail-fast: false matrix: java: [8, 11, 17-ea] - scala: [2.13.6, 3.0.1] + scala: [2.13.6, 3.0.2] runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 diff --git a/build.sbt b/build.sbt index 3853f608..f4d06a80 100644 --- a/build.sbt +++ b/build.sbt @@ -1,4 +1,4 @@ -ThisBuild / crossScalaVersions := Seq("2.13.6", "3.0.1") +ThisBuild / crossScalaVersions := Seq("2.13.6", "3.0.2") ThisBuild / scalaVersion := (ThisBuild / crossScalaVersions).value.head Global / cancelable := true From 9cd18dc27b81c2bd0170e38cc013f10bc4ad75b3 Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Fri, 10 Sep 2021 08:02:00 -0500 Subject: [PATCH 4/6] fix versionPolicyCheck --- build.sbt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build.sbt b/build.sbt index f4d06a80..a7a83d1a 100644 --- a/build.sbt +++ b/build.sbt @@ -1,6 +1,10 @@ ThisBuild / crossScalaVersions := Seq("2.13.6", "3.0.2") ThisBuild / scalaVersion := (ThisBuild / crossScalaVersions).value.head +// shouldn't be necessary anymore after https://github.com/lampepfl/dotty/pull/13498 +// makes it into a release +ThisBuild / libraryDependencySchemes += "org.scala-lang" %% "scala3-library" % "semver-spec" + Global / cancelable := true publish / skip := true // in root From e927561616c00719c8b92d8b316008e4881fef11 Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Fri, 10 Sep 2021 12:30:16 -0500 Subject: [PATCH 5/6] ignore MiMa IncompatibleSignatureProblems --- build.sbt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build.sbt b/build.sbt index a7a83d1a..78b10af6 100644 --- a/build.sbt +++ b/build.sbt @@ -5,6 +5,13 @@ ThisBuild / scalaVersion := (ThisBuild / crossScalaVersions).value.head // makes it into a release ThisBuild / libraryDependencySchemes += "org.scala-lang" %% "scala3-library" % "semver-spec" +// this was necessary to get us from 3.0.0 to 3.0.2, but we should be able to remove +// it after the next release +import com.typesafe.tools.mima.core._ +ThisBuild / mimaBinaryIssueFilters ++= Seq( + ProblemFilters.exclude[IncompatibleSignatureProblem]("*"), +) + Global / cancelable := true publish / skip := true // in root From 897dd6e0017b2f5f4cddd4aa8642b25dbb75635c Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Tue, 28 Sep 2021 16:17:39 -0600 Subject: [PATCH 6/6] CI: test on JDK 17 final --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1eec4537..4953fbc8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,7 @@ jobs: strategy: fail-fast: false matrix: - java: [8, 11, 17-ea] + java: [8, 11, 17] scala: [2.13.6, 3.0.2] runs-on: ubuntu-latest steps: