Skip to content

Commit

Permalink
Added publish/release configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
viktor-podzigun committed Apr 13, 2019
1 parent 2fc7329 commit 1ad43d0
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 17 deletions.
17 changes: 15 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,30 @@ env:
- TRAVIS_SBT_VERSION="1.2.8"
- secure: SVb4Odan6bePQ6v8BhAWYkW2JhHYiS4UojkmEZacEsobjgNAkI4qSGYjC8pcIvBUKnFPafHRG/ggtrZ8ml1beX9bXQxJsmGOutJEMuQyInPUDXdvUHABNBd/8NL8tJhZS6Ijnzbar6i78vizZNW88V9HpWwk2HZQyHw9q5mp1R0nHOG9L1474I62hnc/rclAPecWgUbiTft2mPXRohmb8aFhqAceYao+1g1LY4AuXyPiM3s4sU1YzdL/DJLWVbt8WUAmPUfiAKpGSQY98bBBxCfJrNDezIhENcY/MTo5+cGEcVtfJKu9psL5fShOPUChnnonHSb34/XWyocgN8ZrCQTfhqI1lIzB8HOc3nRiKwPfUcZ2MQ5P4fJi62rzfhEz8/r3HlvhKM+m1++wc7ocsb7+ku59xn93DWYkXKVkD2r3DnzaANd2FMFplopFSEgBJVGTKOXQSSVriMKeTpg2q13PvDhhUTIgOus4MX+n/q4XiAFLygCceRXq1mXFKi0sjWLrJkBldkg8VA1dL31RdK5ZN5K+56gSYPVhvOVeKx2URkbNDV3Y0z8rM33852VI7pdkRuGAZZFfKwVGOFlc5HcbLRln0e2oql1KtOWjyfFicT9pjHfeg2dfIrKBKMrJGavaLdh8kuX/0kKp37SdP+mJtVqJTwwoCXJol6tcl/s=
- secure: IblLuw3rbTHi3Bozgz2h5IUaL9VfdLAdep4u95V4A/GGxR/nfXkfOuxT10c1+OrYc2+KxKDGChhlTvMd6HsHi5LUmPgfgB4MQMXs4OTsBDX3mMD4uSWbzBFyq/Z0YdbJxfQisJkseWDl7HWGuiAJyiRUdLkyEj3L9mtIqqHzs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fUggkw2Y4sgIg0vx6eyyXsac4Axi4ATuX2qhoQlRA+GmrqUsc/Se40/GnwPnJKmys0I5FB8EpQ/Wwq3CFgJ9353jFpbB0OcVcL4JskD8Mv/W1s=
before_install:
- nvm install 6
- nvm use 6
- node --version
- if [ $TRAVIS_PULL_REQUEST = 'false' ]; then
openssl aes-256-cbc -K $encrypted_76f871b6a7fb_key -iv $encrypted_76f871b6a7fb_iv -in travis/secrets.tar.enc -out travis/secrets.tar -d;
tar xv -C travis -f travis/secrets.tar;
fi
script:
- sbt clean coverage test coverageReport &&
sbt coverageAggregate
after_success:
- sbt coveralls
- if [ $TRAVIS_BRANCH = 'master' ] && [[ "$(<version.sbt)" =~ (.*SNAPSHOT.*) ]]; then
sbt clean publish;
- if [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" -o "$TRAVIS_BRANCH" == "$TRAVIS_TAG" ]; then
if [ -z "$TRAVIS_TAG" ]; then
echo "Publish a snapshot";
sbt clean publish;
else
echo "Publish a release version=$TRAVIS_TAG";
version=$TRAVIS_TAG sbt clean publishSigned sonatypeRelease;
fi
else
echo "This is not a master branch commit. Skipping the publish/release step";
fi
cache:
directories:
Expand Down
25 changes: 12 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@

[![Build Status](https://travis-ci.org/scommons/scommons-api.svg?branch=master)](https://travis-ci.org/scommons/scommons-api)
[![Coverage Status](https://coveralls.io/repos/github/scommons/scommons-api/badge.svg?branch=master)](https://coveralls.io/github/scommons/scommons-api?branch=master)
[![scala-index](https://index.scala-lang.org/scommons/scommons-api/scommons-api-core/latest.svg?color=orange)](https://index.scala-lang.org/scommons/scommons-api/scommons-api-core)
[![Scala.js](https://www.scala-js.org/assets/badges/scalajs-0.6.17.svg)](https://www.scala-js.org)

## scommons-api
Common REST API Scala/Scala.js components

### How to add it to your project

Current version is under active development, but you already can try it:
```scala
val scommonsApiVer = "0.1.0-SNAPSHOT"
val scommonsApiVer = "1.0.0-SNAPSHOT"

libraryDependencies ++= Seq(
// shared
Expand Down Expand Up @@ -54,17 +54,16 @@ object User {
}
```

For JS these types:
- [DateTime](joda-time/js/src/main/scala/org/joda/time/DateTime.scala)
- [LocalDate](joda-time/js/src/main/scala/org/joda/time/LocalDate.scala)
- [LocalTime](joda-time/js/src/main/scala/org/joda/time/LocalTime.scala)
For `JS` part the following types are defined as wrappers around
the corresponding `ISO time formatted string`
and do not contain any logic:
- [DateTime](joda-time/js/src/main/scala/org/joda/time/DateTime.scala) => [tests](joda-time/js/src/test/scala/org/joda/time/DateTimeSpec.scala)
- [LocalDate](joda-time/js/src/main/scala/org/joda/time/LocalDate.scala) => [tests](joda-time/js/src/test/scala/org/joda/time/LocalDateSpec.scala)
- [LocalTime](joda-time/js/src/main/scala/org/joda/time/LocalTime.scala) => [tests](joda-time/js/src/test/scala/org/joda/time/LocalTimeSpec.scala)

are defined as wrappers around the corresponding ISO time formatted string
and do not contain any logic.

Once you receive from an API on JS side an object that uses them
you can use `toString` method to get an ISO time formatted string
and pass it to your favorite JS time library to parse it.
Once you receive from an API on `JS` side an object that uses them
you can use `toString` method to get an `ISO time formatted string`
and pass it to your favorite `JS time library` to parse it.

For example, you could use standard [JS Date](https://www.w3schools.com/jS/js_date_methods.asp)
class to parse it:
Expand All @@ -83,4 +82,4 @@ sbt test

## Documentation

You can find documentation [here](https://scommons.org/scommons-api)
You can find more documentation [here](https://scommons.org/scommons-api)
7 changes: 7 additions & 0 deletions pgp.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

//see: https://www.scala-sbt.org/sbt-pgp/usage.html

useGpg := false
pgpPublicRing := file("./travis/pubring.gpg")
pgpSecretRing := file("./travis/secring.gpg")
pgpPassphrase := sys.env.get("PGP_PASS").map(_.toArray)
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ resolvers += "Sonatype Snapshots" at "https://oss.sonatype.org/content/repositor
//use patched versions by now, to make scoverage work with scalajs-bundler
addSbtPlugin(("org.scommons.patched" % "sbt-scalajs-bundler" % "0.14.0-SNAPSHOT").force())

addSbtPlugin(("org.scommons.sbt" % "sbt-scommons-plugin" % "0.1.0-SNAPSHOT").changing())
addSbtPlugin(("org.scommons.sbt" % "sbt-scommons-plugin" % "1.0.0-SNAPSHOT").changing())
2 changes: 2 additions & 0 deletions project/src/main/scala/definitions/ApiModule.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package definitions
import sbt.Keys._
import sbt._
import scommons.sbtplugin.project.CommonModule
import xerial.sbt.Sonatype.autoImport._

trait ApiModule extends CommonModule {

Expand All @@ -22,6 +23,7 @@ object ApiModule {
//
// publish/release related settings:
//
sonatypeProfileName := "org.scommons",
publishMavenStyle := true,
publishArtifact in Test := false,
publishTo := {
Expand Down
Binary file added travis/secrets.tar.enc
Binary file not shown.
2 changes: 1 addition & 1 deletion version.sbt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version in ThisBuild := "0.1.0-SNAPSHOT"
version in ThisBuild := sys.env.getOrElse("version", default = "1.0.0-SNAPSHOT").stripPrefix("v")

0 comments on commit 1ad43d0

Please sign in to comment.