diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..7a13e3a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,91 @@ +name: CI + +env: + JAVA_OPTS: "-Dfile.encoding=UTF-8 -Xms1024M -Xmx3072M -Xss4M -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+UseJVMCICompiler" + +on: + push: + branches: '*' + tags: [ "v[0-9]+*" ] + pull_request: + # avoid duplicate checks (push & PR) further in the review process + types: [opened] + +jobs: + test: + name: Run tests + runs-on: ubuntu-20.04 # https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-README.md + strategy: + fail-fast: false + matrix: + scala: [ 2.12.14, 2.13.6 ] + command: [ test ] + steps: + - uses: actions/checkout@v2 + - name: Cache sbt + uses: actions/cache@v2 + with: + path: | + ~/.sbt + ~/.ivy2/cache + ~/.coursier/cache + ~/.cache/coursier + key: ${{ runner.os }}-sbt-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}-${{ hashFiles('project/Dependencies.scala') }} + restore-keys: ${{ runner.os }}-sbt- + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + - name: Cache npm + uses: actions/cache@v2 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: ${{ runner.os }}-node- + - name: Set up node + uses: actions/setup-node@v2-beta + - name: Run tests + run: sbt "set concurrentRestrictions in Global += Tags.limit(ScalaJSTags.Link, 1)" ++${{ matrix.scala }} ${{ matrix.command }} + + publish: + name: Publish to Sonatype + # only run on tag push + if: github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/v')) + needs: [ test ] + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - name: Cache sbt + uses: actions/cache@v2 + with: + path: | + ~/.sbt + ~/.ivy2/cache + ~/.coursier/cache + ~/.cache/coursier + key: ${{ runner.os }}-sbt-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}-${{ hashFiles('project/Dependencies.scala') }} + restore-keys: ${{ runner.os }}-sbt- + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + - name: Get version + id: get_tag_name + run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/v} + - name: Import GPG key + env: + #exported via `gpg -a --export-secret-keys | cat -e | sed 's/\$/\\n/g' | xclip -selection clipboard` and added to org secrets + SONATYPE_GPG: ${{ secrets.SONATYPE_GPG }} + run: echo -e $SONATYPE_GPG | gpg --import - + - name: Publish artifacts + env: + SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} + run: sbt 'set version in ThisBuild := "${{ steps.get_tag_name.outputs.VERSION }}"' +publishSigned + - name: Release Sonatype bundle + #https://github.com/xerial/sbt-sonatype#publishing-your-artifact + if: ${{ !endsWith(steps.get_tag_name.outputs.VERSION, 'SNAPSHOT') }} + env: + SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} + run: sbt 'set version in ThisBuild := "${{ steps.get_tag_name.outputs.VERSION }}"' sonatypeBundleRelease diff --git a/.gitignore b/.gitignore index c67de7b..de4683c 100644 --- a/.gitignore +++ b/.gitignore @@ -84,7 +84,7 @@ buildNumber.properties ## Plugin-specific files: # IntelliJ -/out/ +out/ # mpeltonen/sbt-idea plugin .idea_modules/ @@ -117,6 +117,7 @@ hs_err_pid* .cache .history .lib/ +.bsp/ dist/* target/ lib_managed/ diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d996112..0000000 --- a/.travis.yml +++ /dev/null @@ -1,37 +0,0 @@ -dist: trusty -language: scala -jdk: openjdk11 -scala: - - 2.13.1 - -jobs: - include: - - stage: test - if: NOT tag =~ ^v - script: - - sbt +test +publishLocal - - cd example && sbt +compileStatics - - stage: release - if: tag =~ ^v - script: - - openssl aes-256-cbc -K $encrypted_f00a6d0a0202_key -iv $encrypted_f00a6d0a0202_iv - -in travis/travis.gpg.enc -out travis/travis.gpg -d - - gpg --import travis/travis.gpg - - test $TRAVIS_PULL_REQUEST = "false" && sbt +publishSigned sonatypeBundleRelease - -before_cache: - - rm -fv $HOME/.ivy2/.sbt.ivy.lock - - find $HOME/.ivy2/cache -name "ivydata-*.properties" -print -delete - - find $HOME/.sbt -name "*.lock" -print -delete - -cache: - directories: - - "$HOME/.ivy2/cache" - - "$HOME/.m2" - - "$HOME/.cache" - - "$HOME/.sbt" - -env: - global: - - secure: rG9cHG3au9EUYQSJKHAsMxws3IW/tSxG1Y/xbuW2Ri1JVr6L6c9ig8gYj4Hju5KkVvxXejb1/8bYCoZEP1vZpNeSkNordHECp0l+i9mI5ZFo5RN3vMCq4/0xWEQTdZ7c3BjN+pn4veDJ+W8cHFXgivC9tsX7FEbksz4bFVIm1knvz5r7HN4ntgQUeLwY/J9EpKSr/TYZsnEcf8aH9q6tvTLqcfYAR6ggs68Kc2qJ5sII0rj3vP2NANjTLuvdkPSe3i/9KCDRDr9KIoVsam4LfFDG8YXSNWBP3OQU86DF19V0brt6WGGX6G5V2dyjlHyyUy0GBFJOlPmfkEL8ylOprGy1OPw40ZPRbtzpbztFlVmgJoO3UcKIWlyB8umz0M9A+E3Of3P9mTnskAe366VPSq8R/G3kxc7ictZDQH7hgf2nKqlFQNXCJkBqynWRlC0HQ31izrACqNmmYdwQspUnAFVOEFSmfXu8sPVyOSQhHT4IG+xgG4KCKdC8Cv4buOFDzj4z0DRnfJwR71KvxA9KGhUtMZXXqfdZANThHMV1bsi3S3UPQKqRg62aja4+I7lzbwrPRbkDPsl0eTdULF39jIMnbfjC2TqeCgfG+tpel0DBMBOuuESvTVFVX38HSgK1QNhSAAu1nrVIFtZQbKDZLOm7hCgfOJO6v65R3PgIFFI= - - secure: wjX1uXAYdNxpUr1nz9cQ96cgJI3wUqJ7hIQlHwtg1gLJJtgdf6STSTbAm1IKMb0Ouytc2muC1H8jhBbv94tyZh2/NI7IDk7OY2wcLobH2Jh/wnDEAAcATIhqR/oFtSdqr0umr1HDevUPIBU/ZFViCPribnCQ/Rxn8jttguGd3Ho1k1dxzJ9pEiET66nU8CnW0j8g1Nkg540xFPff0Q+1C7+3akU03KwLnh8C0KR1oGhT354IhocLtFKWPuD9GTXAiA6qcOZ0cmUlv8jwHhWyJ6dmVkOlv873nGPrFaWEDPepNkGaAz2TYjkeFS0YS8q1zbd7YM0opnQd8TJCnFddyzc09+1d5RMAJVWdKOKVjrbDwvKaNWfEHW6GXJ83xm8cbo3dCREfL7UTKjejkQTRgmj2BdrZVRB9xs+XKZpZi0ECVbIrwik9tyYoiuSHe96yNN3Ma56Q4x094ZTvsccjy7pET4FCpNwrFu0aD+HFPerWB/xlr9ILz7sWy99r4eafS+O2eidoQnPIHAHZ+z/k9ExQedKUzTxO/skgrf1FvswrY7cpfnNApOhCSKm8C5NfMB5BC7M7OsYqDIhIwfs/Q3J9gw18F4fa9czpnduVzkpQUGdZ2vtS+oxDGICB7uaxkRq7HudHHElhz4w9qEOIMpTJjICPa38Hr/fKGxpuhKE= \ No newline at end of file diff --git a/README.md b/README.md index 88ff328..32fdc79 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # udash-jquery [](http://www.avsystem.com/) -[![Build Status](https://travis-ci.org/UdashFramework/scala-js-jquery.svg?branch=master)](https://travis-ci.org/UdashFramework/scala-js-jquery) -[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.udash/udash-jquery_sjs1_2.12/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.udash/udash-jquery_sjs1_2.12) +![Build Status](https://github.com/UdashFramework/scala-js-jquery.svg/workflows/CI/badge.svg?branch=master&event=push) +[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.udash/udash-jquery_sjs1_2.13/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.udash/udash-jquery_sjs1_2.13) [![Join the chat at https://gitter.im/UdashFramework/scala-js-jquery](https://badges.gitter.im/UdashFramework/scala-js-jquery.svg)](https://gitter.im/UdashFramework/scala-js-jquery?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) Static types for the jQuery API for [Scala.js](http://www.scala-js.org/) programs. diff --git a/build.sbt b/build.sbt index 8482c85..b04eb23 100644 --- a/build.sbt +++ b/build.sbt @@ -1,14 +1,13 @@ name := "udash-jquery" inThisBuild(Seq( - version := sys.env.get("TRAVIS_TAG").filter(_.startsWith("v")).map(_.drop(1)).getOrElse("3.0.0-SNAPSHOT"), + version := "3.1.0-SNAPSHOT", organization := "io.udash", - cancelable := true, )) val commonSettings = Seq( - scalaVersion := "2.13.1", - crossScalaVersions := Seq("2.12.11", "2.13.1"), + scalaVersion := "2.13.6", + crossScalaVersions := Seq("2.13.6", "2.12.14"), scalacOptions ++= Seq( "-feature", "-deprecation", @@ -16,18 +15,29 @@ val commonSettings = Seq( "-language:implicitConversions", "-language:existentials", "-language:dynamics", - "-language:postfixOps", "-language:experimental.macros", "-Xfatal-warnings", "-Xlint:_", - "-Ywarn-unused:_,-explicits,-implicits", - "-Ybackend-parallelism", "4", + "-Ybackend-parallelism", "8", "-Ycache-plugin-class-loader:last-modified", "-Ycache-macro-class-loader:last-modified", ), - autoAPIMappings := true, +) + +val commonJSSettings = Seq( + Test / scalaJSStage := FastOptStage, + Test / requireJsDomEnv := true, + npmExtraArgs += "--silent", + scalacOptions += { + val localDir = (ThisBuild / baseDirectory).value.toURI.toString + val githubDir = "https://raw.githubusercontent.com/UdashFramework/scala-js-jquery" + s"-P:scalajs:mapSourceURI:$localDir->$githubDir/v${version.value}/" + }, +) + +val deploymentConfiguration = Seq( publishMavenStyle := true, - publishArtifact in Test := false, + Test / publishArtifact := false, pomIncludeRepository := { _ => false }, publishTo := sonatypePublishToBundle.value, @@ -62,27 +72,17 @@ val commonSettings = Seq( } ) -val commonJSSettings = Seq( - Test / scalaJSStage := FastOptStage, - Test / requireJsDomEnv := true, - npmExtraArgs += "--silent", - scalacOptions += { - val localDir = (ThisBuild / baseDirectory).value.toURI.toString - val githubDir = "https://raw.githubusercontent.com/UdashFramework/scala-js-jquery" - s"-P:scalajs:mapSourceURI:$localDir->$githubDir/v${version.value}/" - }, -) - lazy val root = project.in(file(".")) .enablePlugins(ScalaJSBundlerPlugin, JSDependenciesPlugin) .settings( commonSettings, commonJSSettings, + deploymentConfiguration, libraryDependencies ++= Seq( - "org.scala-js" %%% "scalajs-dom" % "0.9.8", - "org.scalatest" %%% "scalatest" % "3.1.1" % Test, - "com.lihaoyi" %%% "scalatags" % "0.8.6" % Test + "org.scala-js" %%% "scalajs-dom" % "1.2.0", + "org.scalatest" %%% "scalatest" % "3.2.9" % Test, + "com.lihaoyi" %%% "scalatags" % "0.9.4" % Test ), Compile / npmDependencies += "jquery" -> "3.4.1", diff --git a/project/build.properties b/project/build.properties index ef622e7..e9db047 100755 --- a/project/build.properties +++ b/project/build.properties @@ -1,2 +1,2 @@ # suppress inspection "UnusedProperty" -sbt.version=1.3.9 \ No newline at end of file +sbt.version=1.5.5 \ No newline at end of file diff --git a/project/plugins.sbt b/project/plugins.sbt index 84c42cf..fa81d0b 100755 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,9 +1,9 @@ logLevel := Level.Warn -addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.0.1") -addSbtPlugin("ch.epfl.scala" % "sbt-scalajs-bundler" % "0.17.0") -addSbtPlugin("org.scala-js" % "sbt-jsdependencies" % "1.0.0") +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.7.0") +addSbtPlugin("ch.epfl.scala" % "sbt-scalajs-bundler" % "0.20.0") +addSbtPlugin("org.scala-js" % "sbt-jsdependencies" % "1.0.2") // Deployment configuration -addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.0.1") -addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.8.1") \ No newline at end of file +addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2") +addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.10") \ No newline at end of file diff --git a/travis/travis.gpg.enc b/travis/travis.gpg.enc deleted file mode 100644 index 399e477..0000000 Binary files a/travis/travis.gpg.enc and /dev/null differ