This repository has been archived by the owner on Jun 23, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New scala-module-plugin with sbt-ci-release / travisci / dynver / header
- Loading branch information
Showing
13 changed files
with
111 additions
and
245 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,42 @@ | ||
language: scala | ||
|
||
scala: | ||
- 2.11.12 | ||
- 2.12.8 | ||
- 2.12.9 | ||
- 2.12.10 | ||
|
||
env: | ||
global: | ||
# PGP_PASSPHRASE | ||
- secure: "ImY9KGs8EmTk1mPgZJEWqfy0GR7Wp2lZ07z1eSVwMQTGvYZIPZchNa30jzjB4YVHrG5PvwOSXaGx3ivFRZk/FElWbJ1skFXfHz+JwvNRvN6fhNIhoD0mkPWDTDtA3NnlLen4hbC9rZCPuP4RqrS1jy2nZuD36ZLx2NU9tQM6tUc=" | ||
# SONA_USER | ||
- secure: "f0Acd/hWkgHoT5uyFL+K3D8DB2bRSoXRJhnTueMzJvTHBJZd2kpPo9t7YsmH7fowopVMCcBPzfRyiPoJVf4CJKc/SHCKn/YMJInCC1YPOrchLX/ShTPTeaP4lxFnm/bmmdPOmqfLSQsPIuEP6LBffsq1lvLO6VL61QrDy+D4EQs=" | ||
# SONA_PASS | ||
- secure: "E6OE1MoZ4VQHRNtEyyKfmnj8Bj7uGpgHLmlvJR/iy7qdxBbNA8cEz/Qs64uTft5zfZ9bJsQhiuxLcTtFKYKFP4qvExz8FyilhmUwKjD5Eux4FAeBjDBeXBETM1JYFB+JYP9l8dcQecMeGpd46I52pLjYYmNyQQ1YpOvK29GIQLA=" | ||
- ADOPTOPENJDK=8 | ||
- ADOPTOPENJDK=11 | ||
|
||
before_install: | ||
# adding $HOME/.sdkman to cache would create an empty directory, which interferes with the initial installation | ||
- "[[ -d $HOME/.sdkman/bin ]] || rm -rf $HOME/.sdkman/" | ||
- curl -sL https://get.sdkman.io | bash | ||
- echo sdkman_auto_answer=true > $HOME/.sdkman/etc/config | ||
- source "$HOME/.sdkman/bin/sdkman-init.sh" | ||
|
||
script: | ||
- admin/build.sh | ||
install: | ||
- sdk install java $(sdk list java | grep -o "$ADOPTOPENJDK\.[0-9\.]*hs-adpt" | head -1) | ||
- unset JAVA_HOME | ||
- java -Xmx32m -version | ||
- git fetch --tags # get all tags for sbt-dynver | ||
|
||
jdk: | ||
- openjdk8 | ||
- openjdk11 | ||
script: ./build.sh | ||
|
||
notifications: | ||
email: | ||
- adriaan.moors@lightbend.com | ||
- seth.tisue@lightbend.com | ||
|
||
before_cache: | ||
- rm -f $HOME/.ivy2/.sbt.ivy.lock | ||
- find $HOME/.ivy2/cache -name "ivydata-*.properties" | xargs rm | ||
- find $HOME/.sbt -name "*.lock" | xargs rm | ||
cache: | ||
directories: | ||
- $HOME/.ivy2/cache | ||
- $HOME/.sbt | ||
- $HOME/.cache/coursier | ||
- $HOME/.sdkman |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Builds of tagged revisions are published to sonatype staging. | ||
|
||
# Travis runs a build on new revisions and on new tags, so a tagged revision is built twice. | ||
# Builds for a tag have TRAVIS_TAG defined, which we use for identifying tagged builds. | ||
|
||
# sbt-dynver sets the version number from the tag | ||
# sbt-travisci sets the Scala version from the travis job matrix | ||
|
||
# When a new binary incompatible Scala version becomes available, a previously released version | ||
# can be released using that new Scala version by creating a new tag containing the Scala version | ||
# after a hash, e.g., v1.2.3#2.13.0-M3. In this situation, the first job of the travis job | ||
# matrix builds the release. All other jobs are stopped. Make sure that the first job uses | ||
# the desired JVM version. | ||
|
||
# For normal tags that are cross-built, we release on JDK 8 for Scala 2.x | ||
isReleaseJob() { | ||
if [[ "$ADOPTOPENJDK" == "8" ]]; then | ||
true | ||
else | ||
false | ||
fi | ||
} | ||
|
||
# For tags that define a Scala version, we pick the jobs of one Scala version (2.13.x) to do the releases | ||
isTagScalaReleaseJob() { | ||
if [[ "$ADOPTOPENJDK" == "8" && "$TRAVIS_SCALA_VERSION" =~ ^2\.13\.[0-9]+$ ]]; then | ||
true | ||
else | ||
false | ||
fi | ||
} | ||
|
||
verPat="[0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9-]+)?" | ||
tagPat="^v$verPat(#$verPat)?$" | ||
|
||
if [[ "$TRAVIS_TAG" =~ $tagPat ]]; then | ||
releaseTask="ci-release" | ||
tagScalaVer=$(echo $TRAVIS_TAG | sed s/[^#]*// | sed s/^#//) | ||
if [[ "$tagScalaVer" == "" ]]; then | ||
if ! isReleaseJob; then | ||
echo "Not releasing on Java $ADOPTOPENJDK with Scala $TRAVIS_SCALA_VERSION" | ||
exit 0 | ||
fi | ||
else | ||
if isTagScalaReleaseJob; then | ||
setTagScalaVersion='set every scalaVersion := "'$tagScalaVer'"' | ||
else | ||
echo "The releases for Scala $tagScalaVer are built by other jobs in the travis job matrix" | ||
exit 0 | ||
fi | ||
fi | ||
fi | ||
# default is +publishSigned; we cross-build with travis jobs, not sbt's crossScalaVersions | ||
export CI_RELEASE="publishSigned" | ||
export CI_SNAPSHOT_RELEASE="publish" | ||
# default is sonatypeBundleRelease, which closes and releases the staging repo | ||
# see https://github.com/xerial/sbt-sonatype#commands | ||
# for now, until we're confident in the new release scripts, just close the staging repo. | ||
export CI_SONATYPE_RELEASE="; sonatypePrepare; sonatypeBundleUpload; sonatypeClose" | ||
sbt "$setTagScalaVersion" clean test publishLocal $releaseTask |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
sbt.version=1.2.8 | ||
sbt.version=1.3.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % "2.0.0") | ||
addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % "2.1.2") |