Skip to content

Commit f857ff5

Browse files
authored
Merge pull request #29 from UdashFramework/upgrades
GitHub Actions + dependency upgrades for 3.1.x
2 parents 85a5ce2 + fdc9036 commit f857ff5

File tree

8 files changed

+124
-69
lines changed

8 files changed

+124
-69
lines changed

.github/workflows/ci.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: CI
2+
3+
env:
4+
JAVA_OPTS: "-Dfile.encoding=UTF-8 -Xms1024M -Xmx3072M -Xss4M -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+UseJVMCICompiler"
5+
6+
on:
7+
push:
8+
branches: '*'
9+
tags: [ "v[0-9]+*" ]
10+
pull_request:
11+
# avoid duplicate checks (push & PR) further in the review process
12+
types: [opened]
13+
14+
jobs:
15+
test:
16+
name: Run tests
17+
runs-on: ubuntu-20.04 # https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-README.md
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
scala: [ 2.12.14, 2.13.6 ]
22+
command: [ test ]
23+
steps:
24+
- uses: actions/checkout@v2
25+
- name: Cache sbt
26+
uses: actions/cache@v2
27+
with:
28+
path: |
29+
~/.sbt
30+
~/.ivy2/cache
31+
~/.coursier/cache
32+
~/.cache/coursier
33+
key: ${{ runner.os }}-sbt-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}-${{ hashFiles('project/Dependencies.scala') }}
34+
restore-keys: ${{ runner.os }}-sbt-
35+
- name: Set up JDK 11
36+
uses: actions/setup-java@v1
37+
with:
38+
java-version: 11
39+
- name: Cache npm
40+
uses: actions/cache@v2
41+
with:
42+
path: ~/.npm
43+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
44+
restore-keys: ${{ runner.os }}-node-
45+
- name: Set up node
46+
uses: actions/setup-node@v2-beta
47+
- name: Run tests
48+
run: sbt "set concurrentRestrictions in Global += Tags.limit(ScalaJSTags.Link, 1)" ++${{ matrix.scala }} ${{ matrix.command }}
49+
50+
publish:
51+
name: Publish to Sonatype
52+
# only run on tag push
53+
if: github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/v'))
54+
needs: [ test ]
55+
runs-on: ubuntu-20.04
56+
steps:
57+
- uses: actions/checkout@v2
58+
- name: Cache sbt
59+
uses: actions/cache@v2
60+
with:
61+
path: |
62+
~/.sbt
63+
~/.ivy2/cache
64+
~/.coursier/cache
65+
~/.cache/coursier
66+
key: ${{ runner.os }}-sbt-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}-${{ hashFiles('project/Dependencies.scala') }}
67+
restore-keys: ${{ runner.os }}-sbt-
68+
- name: Set up JDK 11
69+
uses: actions/setup-java@v1
70+
with:
71+
java-version: 11
72+
- name: Get version
73+
id: get_tag_name
74+
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/v}
75+
- name: Import GPG key
76+
env:
77+
#exported via `gpg -a --export-secret-keys <key> | cat -e | sed 's/\$/\\n/g' | xclip -selection clipboard` and added to org secrets
78+
SONATYPE_GPG: ${{ secrets.SONATYPE_GPG }}
79+
run: echo -e $SONATYPE_GPG | gpg --import -
80+
- name: Publish artifacts
81+
env:
82+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
83+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
84+
run: sbt 'set version in ThisBuild := "${{ steps.get_tag_name.outputs.VERSION }}"' +publishSigned
85+
- name: Release Sonatype bundle
86+
#https://github.com/xerial/sbt-sonatype#publishing-your-artifact
87+
if: ${{ !endsWith(steps.get_tag_name.outputs.VERSION, 'SNAPSHOT') }}
88+
env:
89+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
90+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
91+
run: sbt 'set version in ThisBuild := "${{ steps.get_tag_name.outputs.VERSION }}"' sonatypeBundleRelease

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ buildNumber.properties
8484
## Plugin-specific files:
8585

8686
# IntelliJ
87-
/out/
87+
out/
8888

8989
# mpeltonen/sbt-idea plugin
9090
.idea_modules/
@@ -117,6 +117,7 @@ hs_err_pid*
117117
.cache
118118
.history
119119
.lib/
120+
.bsp/
120121
dist/*
121122
target/
122123
lib_managed/

.travis.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# udash-jquery [<img align="right" height="50px" src="https://avsystem.github.io/Anjay-doc/_images/avsystem_logo.png">](http://www.avsystem.com/)
2-
[![Build Status](https://travis-ci.org/UdashFramework/scala-js-jquery.svg?branch=master)](https://travis-ci.org/UdashFramework/scala-js-jquery)
3-
[![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)
2+
![Build Status](https://github.com/UdashFramework/scala-js-jquery.svg/workflows/CI/badge.svg?branch=master&event=push)
3+
[![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)
44
[![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)
55

66
Static types for the jQuery API for [Scala.js](http://www.scala-js.org/) programs.

build.sbt

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,43 @@
11
name := "udash-jquery"
22

33
inThisBuild(Seq(
4-
version := sys.env.get("TRAVIS_TAG").filter(_.startsWith("v")).map(_.drop(1)).getOrElse("3.0.0-SNAPSHOT"),
4+
version := "3.1.0-SNAPSHOT",
55
organization := "io.udash",
6-
cancelable := true,
76
))
87

98
val commonSettings = Seq(
10-
scalaVersion := "2.13.1",
11-
crossScalaVersions := Seq("2.12.11", "2.13.1"),
9+
scalaVersion := "2.13.6",
10+
crossScalaVersions := Seq("2.13.6", "2.12.14"),
1211
scalacOptions ++= Seq(
1312
"-feature",
1413
"-deprecation",
1514
"-unchecked",
1615
"-language:implicitConversions",
1716
"-language:existentials",
1817
"-language:dynamics",
19-
"-language:postfixOps",
2018
"-language:experimental.macros",
2119
"-Xfatal-warnings",
2220
"-Xlint:_",
23-
"-Ywarn-unused:_,-explicits,-implicits",
24-
"-Ybackend-parallelism", "4",
21+
"-Ybackend-parallelism", "8",
2522
"-Ycache-plugin-class-loader:last-modified",
2623
"-Ycache-macro-class-loader:last-modified",
2724
),
28-
autoAPIMappings := true,
25+
)
26+
27+
val commonJSSettings = Seq(
28+
Test / scalaJSStage := FastOptStage,
29+
Test / requireJsDomEnv := true,
30+
npmExtraArgs += "--silent",
31+
scalacOptions += {
32+
val localDir = (ThisBuild / baseDirectory).value.toURI.toString
33+
val githubDir = "https://raw.githubusercontent.com/UdashFramework/scala-js-jquery"
34+
s"-P:scalajs:mapSourceURI:$localDir->$githubDir/v${version.value}/"
35+
},
36+
)
37+
38+
val deploymentConfiguration = Seq(
2939
publishMavenStyle := true,
30-
publishArtifact in Test := false,
40+
Test / publishArtifact := false,
3141
pomIncludeRepository := { _ => false },
3242

3343
publishTo := sonatypePublishToBundle.value,
@@ -62,27 +72,17 @@ val commonSettings = Seq(
6272
}
6373
)
6474

65-
val commonJSSettings = Seq(
66-
Test / scalaJSStage := FastOptStage,
67-
Test / requireJsDomEnv := true,
68-
npmExtraArgs += "--silent",
69-
scalacOptions += {
70-
val localDir = (ThisBuild / baseDirectory).value.toURI.toString
71-
val githubDir = "https://raw.githubusercontent.com/UdashFramework/scala-js-jquery"
72-
s"-P:scalajs:mapSourceURI:$localDir->$githubDir/v${version.value}/"
73-
},
74-
)
75-
7675
lazy val root = project.in(file("."))
7776
.enablePlugins(ScalaJSBundlerPlugin, JSDependenciesPlugin)
7877
.settings(
7978
commonSettings,
8079
commonJSSettings,
80+
deploymentConfiguration,
8181

8282
libraryDependencies ++= Seq(
83-
"org.scala-js" %%% "scalajs-dom" % "0.9.8",
84-
"org.scalatest" %%% "scalatest" % "3.1.1" % Test,
85-
"com.lihaoyi" %%% "scalatags" % "0.8.6" % Test
83+
"org.scala-js" %%% "scalajs-dom" % "1.2.0",
84+
"org.scalatest" %%% "scalatest" % "3.2.9" % Test,
85+
"com.lihaoyi" %%% "scalatags" % "0.9.4" % Test
8686
),
8787

8888
Compile / npmDependencies += "jquery" -> "3.4.1",

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# suppress inspection "UnusedProperty"
2-
sbt.version=1.3.9
2+
sbt.version=1.5.5

project/plugins.sbt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
logLevel := Level.Warn
22

3-
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.0.1")
4-
addSbtPlugin("ch.epfl.scala" % "sbt-scalajs-bundler" % "0.17.0")
5-
addSbtPlugin("org.scala-js" % "sbt-jsdependencies" % "1.0.0")
3+
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.7.0")
4+
addSbtPlugin("ch.epfl.scala" % "sbt-scalajs-bundler" % "0.20.0")
5+
addSbtPlugin("org.scala-js" % "sbt-jsdependencies" % "1.0.2")
66

77
// Deployment configuration
8-
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.0.1")
9-
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.8.1")
8+
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2")
9+
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.10")

travis/travis.gpg.enc

-3.63 KB
Binary file not shown.

0 commit comments

Comments
 (0)