Skip to content

Commit

Permalink
Update to release on scala.js 1.0.1
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Quiroz <carlos.m.quiroz@gmail.com>
  • Loading branch information
cquiroz committed Mar 6, 2020
1 parent bea2208 commit 0265c1c
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 4 deletions.
16 changes: 16 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name-template: 'v$NEXT_PATCH_VERSION'
tag-template: 'v$NEXT_PATCH_VERSION'
template: |
# What's Changed
$CHANGES
categories:
- title: 'New'
label: 'type: feature'
- title: 'Bug Fixes'
label: 'type: bug'
- title: 'Maintenance'
label: 'type: maintenance'
- title: 'Documentation'
label: 'type: docs'
- title: 'Dependency Updates'
label: 'type: dependencies'
16 changes: 16 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Release Drafter

on:
push:
# branches to consider in the event; optional, defaults to all
branches:
- master

jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ jobs:
- uses: olafurpg/setup-scala@v2
- uses: olafurpg/setup-gpg@v2
- name: Publish
run: csbt ci-release
run: |
csbt ci-release
SCALAJS_VERSION=0.6.32 csbt clean ci-release
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/scala.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ jobs:
- name: Run tests
run: |
csbt +macroUtils/publishLocal +testSuiteJS/test +testSuiteJVM/test
SCALAJS_VERSION=0.6.32 csbt clean +macroUtils/publishLocal +testSuiteJS/test +testSuiteJVM/test
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

![build](https://github.com/cquiroz/scala-java-locales/workflows/build/badge.svg)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.github.cquiroz/scala-java-locales_sjs0.6_2.12/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.github.cquiroz/scala-java-locales_sjs0.6_2.12)
[![Scala.js](https://www.scala-js.org/assets/badges/scalajs-1.0.0.svg)](https://www.scala-js.org/)
[![Scala.js](https://www.scala-js.org/assets/badges/scalajs-0.6.29.svg)](https://www.scala-js.org/)

`scala-java-locales` is a clean-room BSD-licensed implementation of the `java.util.Locale` API and related classes as defined on JDK8, mostly for Scala.js usage. It enables the locale API in Scala.js projects and supports usage requiring locales like number and dates formatting.
Expand Down Expand Up @@ -51,8 +52,14 @@ libraryDependencies += "com.github.cquiroz" %%% "locales-minimal-en-db" % "0.6.0

## Default Locale

It is **highly** recommended that you set a default locale for your application with, e.g.
Starting on 0.6.0 it is no longer necessary to register locales but only a minimal locale based on english is
provided. You may want to use [sbt-locales](https://github.com/cquiroz/sbt-locales) to generate
a custom locale database.

For example see:
[gemini-locales](https://github.com/gemini-hlsw/gemini-locales/)

It is probably a good idea to set your default Locale
```
Locale.setDefault(Locale.forLanguageTag(<my-locale>))
```
Expand All @@ -76,7 +83,6 @@ Locales and the CLDR specifications are vast subjects. The locales in this proje
In general the API attempts to behave be as close as possible to what happens on the JVM, e.g. the numeric system in Java seems to default to `latn` unless explicitly requested on the locale name.

## Demo

A very simple `Scala.js` project is available at [scalajs-locales-demo](https://github.com/cquiroz/scalajs-locales-demo)

## Dependencies
Expand Down
12 changes: 12 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Global / onChangedBuildSource := ReloadOnSourceChanges

resolvers in Global += Resolver.sonatypeRepo("public")

val scalaJSVersion06 = Option(System.getenv("SCALAJS_VERSION")).exists(_.startsWith("0.6"))

val commonSettings: Seq[Setting[_]] = Seq(
cldrDbVersion := "36",
organization := "io.github.cquiroz",
Expand Down Expand Up @@ -94,6 +96,9 @@ lazy val core = crossProject(JVMPlatform, JSPlatform)
}
}
)
.jvmSettings(
skip.in(publish) := scalaJSVersion06
)

lazy val localesFullCurrenciesDb = crossProject(JVMPlatform, JSPlatform)
.settings(commonSettings: _*)
Expand All @@ -110,6 +115,9 @@ lazy val localesFullCurrenciesDb = crossProject(JVMPlatform, JSPlatform)
supportISOCodes := true,
libraryDependencies += "org.portable-scala" %%% "portable-scala-reflect" % "1.0.0"
)
.jvmSettings(
skip.in(publish) := scalaJSVersion06
)

lazy val localesFullDb = crossProject(JVMPlatform, JSPlatform)
.settings(commonSettings: _*)
Expand All @@ -126,6 +134,9 @@ lazy val localesFullDb = crossProject(JVMPlatform, JSPlatform)
supportISOCodes := true,
libraryDependencies += "org.portable-scala" %%% "portable-scala-reflect" % "1.0.0"
)
.jvmSettings(
skip.in(publish) := scalaJSVersion06
)

lazy val localesMinimalEnDb = crossProject(JVMPlatform, JSPlatform)
.settings(commonSettings: _*)
Expand All @@ -150,6 +161,7 @@ lazy val testSuite = crossProject(JVMPlatform, JSPlatform)
publishLocal := {},
publishArtifact := false,
name := "scala-java-locales test",
crossScalaVersions := Seq("2.12.10", "2.13.1"), // munit isn't working properly on tests
libraryDependencies += "org.scalameta" %%% "munit" % "0.5.2",
testFrameworks += new TestFramework("munit.Framework"),
scalacOptions ~= (_.filterNot(
Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
resolvers += Resolver.sonatypeRepo("public")

val scalaJSVersion =
Option(System.getenv("SCALAJS_VERSION")).getOrElse("0.6.32")
Option(System.getenv("SCALAJS_VERSION")).getOrElse("1.0.1")

addSbtPlugin("org.scala-js" % "sbt-scalajs" % scalaJSVersion)
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.0.0")
Expand Down

0 comments on commit 0265c1c

Please sign in to comment.