From 56f561123abd704127facd81e31a7d822ab808ed Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Tue, 31 Aug 2021 15:48:31 -0400 Subject: [PATCH] replace Travis-CI with GitHub Actions --- .github/workflows/ci.yml | 23 ++++++++++++ .github/workflows/release.yml | 21 +++++++++++ .travis.yml | 24 ------------- README.md | 14 +++----- build.sh | 66 ----------------------------------- project/plugins.sbt | 2 +- 6 files changed, 50 insertions(+), 100 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..429d9ce --- /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.12.14, 2.13.6] + 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 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 8404aae..0000000 --- a/.travis.yml +++ /dev/null @@ -1,24 +0,0 @@ -version: ~> 1.0 # needed for imports - -import: scala/scala-dev:travis/default.yml - -language: scala - -scala: - - 2.12.14 - - 2.13.6 - -env: - - ADOPTOPENJDK=8 - - ADOPTOPENJDK=11 - - ADOPTOPENJDK=17 - -install: - - git fetch --tags # get all tags for sbt-dynver - -script: ./build.sh - -notifications: - email: - - jason.zaugg@lightbend.com - - seth.tisue@lightbend.com diff --git a/README.md b/README.md index f3e5f0e..3a46654 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,8 @@ -# scala-async [![Build Status](https://travis-ci.org/scala/scala-async.svg?branch=master)](https://travis-ci.org/scala/scala-async) [](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aorg.scala-lang.modules%20a%3Ascala-async_2.12) [](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aorg.scala-lang.modules%20a%3Ascala-async_2.13) +# scala-async [](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aorg.scala-lang.modules%20a%3Ascala-async_2.12) [](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aorg.scala-lang.modules%20a%3Ascala-async_2.13) -A DSL to enable a direct style of programming with when composing values wrapped in Scala `Future`s. +A Scala DSL to enable a direct style of coding when composing `Future`s. -## Quick start - -To include scala-async in an existing project use the library published on Maven Central. -For sbt projects add the following to your build definition - build.sbt or project/Build.scala: - -### Use a modern Scala compiler +## Usage As of scala-async 1.0, Scala 2.12.12+ or 2.13.3+ are required. @@ -44,6 +39,7 @@ to match your project’s Scala binary version): Add the `-Xasync` to the Scala compiler options. #### SBT Example + ```scala scalacOptions += "-Xasync" ``` @@ -133,7 +129,7 @@ def combined: Future[Int] = async { ### `await` must be directly in the control flow of the async expression -The `await` cannot be nested under a local method, object, class or lambda: +The `await` cannot be nested under a local method, object, class or lambda: ``` async { diff --git a/build.sh b/build.sh deleted file mode 100755 index 7b807f8..0000000 --- a/build.sh +++ /dev/null @@ -1,66 +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 - -# When a new binary incompatible Scala version becomes available, a previously released version -# can be released using that new Scala version by creating a new tag containing the Scala version -# after a hash, e.g., v1.2.3#2.13.0-M3. - -# For normal tags that are cross-built, we release on JDK 8 for Scala 2.x -isReleaseJob() { - if [[ "$ADOPTOPENJDK" == "8" ]]; then - true - else - false - fi -} - -# For tags that define a Scala version, we pick the jobs of one Scala version (2.13.x) to do the releases -isTagScalaReleaseJob() { - if [[ "$ADOPTOPENJDK" == "8" && "$TRAVIS_SCALA_VERSION" =~ ^2\.13\.[0-9]+$ ]]; then - true - else - false - fi -} - -verPat="[0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9-]+)?" -tagPat="^v$verPat(#$verPat)?$" - -if [[ "$TRAVIS_TAG" =~ $tagPat ]]; then - releaseTask="ci-release" - versionCheckTask="versionCheck" - tagScalaVer=$(echo $TRAVIS_TAG | sed s/[^#]*// | sed s/^#//) - if [[ "$tagScalaVer" == "" ]]; then - if ! isReleaseJob; then - echo "Not releasing on Java $ADOPTOPENJDK with Scala $TRAVIS_SCALA_VERSION" - exit 0 - fi - else - if isTagScalaReleaseJob; then - setTagScalaVersion='set every scalaVersion := "'$tagScalaVer'"' - else - echo "The releases for Scala $tagScalaVer are built by other jobs in the travis job matrix" - exit 0 - fi - fi -fi - -# default is +publishSigned; we cross-build with travis jobs, not sbt's crossScalaVersions -export CI_RELEASE="publishSigned" -export CI_SNAPSHOT_RELEASE="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 "$setTagScalaVersion" clean test publishLocal $versionCheckTask $releaseTask diff --git a/project/plugins.sbt b/project/plugins.sbt index 5d5094e..eeb99fd 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,3 +1,3 @@ -addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % "2.4.0") +addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % "3.0.0-RC3") addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.7.0") addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.0.0")