Skip to content

GitHub Actions + dependency upgrades for 3.1.x #29

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

Merged
merged 5 commits into from
Aug 27, 2021
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
91 changes: 91 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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 <key> | 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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ buildNumber.properties
## Plugin-specific files:

# IntelliJ
/out/
out/

# mpeltonen/sbt-idea plugin
.idea_modules/
Expand Down Expand Up @@ -117,6 +117,7 @@ hs_err_pid*
.cache
.history
.lib/
.bsp/
dist/*
target/
lib_managed/
Expand Down
37 changes: 0 additions & 37 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# udash-jquery [<img align="right" height="50px" src="https://avsystem.github.io/Anjay-doc/_images/avsystem_logo.png">](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.
Expand Down
46 changes: 23 additions & 23 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,33 +1,43 @@
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",
"-unchecked",
"-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,
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# suppress inspection "UnusedProperty"
sbt.version=1.3.9
sbt.version=1.5.5
10 changes: 5 additions & 5 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -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")
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.10")
Binary file removed travis/travis.gpg.enc
Binary file not shown.