Skip to content

Commit 7278b76

Browse files
Merge pull request #3 from scala-exercises/add-scala-exercises-org-settings-and-ci
Library Settings and CI Configuration
2 parents 997e5a1 + ad41b56 commit 7278b76

File tree

6 files changed

+60
-6
lines changed

6 files changed

+60
-6
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,4 @@ bin/
3232
.DS_Store
3333

3434
# PGP keys
35-
pubring.gpg
3635
secring.gpg

.travis.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
language: scala
22
scala:
3-
- 2.11.8
3+
- 2.11.8
44
jdk:
5-
- oraclejdk8
5+
- oraclejdk8
66
script:
7-
- sbt test
7+
- sbt test
8+
- if [ "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then
9+
openssl aes-256-cbc -K $encrypted_40545b9562dd_key -iv $encrypted_40545b9562dd_iv
10+
-in secring.gpg.enc -out secring.gpg -d;
11+
fi
12+
after_success:
13+
- if [ "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then sbt
14+
compile publishSigned; fi

build.sbt

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
lazy val `scala-tutorial` = (project in file("."))
22
.enablePlugins(ExerciseCompilerPlugin)
3+
.settings(publishSettings:_*)
34
.settings(
45
organization := "org.scala-exercises",
56
name := "exercises-scalatutorial",
@@ -17,4 +18,32 @@ lazy val `scala-tutorial` = (project in file("."))
1718
"com.github.alexarchambault" %% "scalacheck-shapeless_1.12" % "0.3.1",
1819
compilerPlugin("org.spire-math" %% "kind-projector" % "0.7.1")
1920
)
20-
)
21+
)
22+
23+
// Distribution
24+
25+
lazy val gpgFolder = sys.env.getOrElse("PGP_FOLDER", ".")
26+
27+
lazy val publishSettings = Seq(
28+
organizationName := "Scala Exercises",
29+
organizationHomepage := Some(new URL("http://scala-exercises.org")),
30+
startYear := Some(2016),
31+
description := "Scala Exercises: The path to enlightenment",
32+
homepage := Some(url("http://scala-exercises.org")),
33+
pgpPassphrase := Some(sys.env.getOrElse("PGP_PASSPHRASE", "").toCharArray),
34+
pgpPublicRing := file(s"$gpgFolder/pubring.gpg"),
35+
pgpSecretRing := file(s"$gpgFolder/secring.gpg"),
36+
credentials += Credentials("Sonatype Nexus Repository Manager", "oss.sonatype.org", sys.env.getOrElse("PUBLISH_USERNAME", ""), sys.env.getOrElse("PUBLISH_PASSWORD", "")),
37+
scmInfo := Some(ScmInfo(url("https://github.com/scala-exercises/exercises-scalatutorial"), "https://github.com/scala-exercises/exercises-scalatutorial.git")),
38+
licenses := Seq("Apache License, Version 2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0.txt")),
39+
publishMavenStyle := true,
40+
publishArtifact in Test := false,
41+
pomIncludeRepository := Function.const(false),
42+
publishTo := {
43+
val nexus = "https://oss.sonatype.org/"
44+
if (isSnapshot.value)
45+
Some("Snapshots" at nexus + "content/repositories/snapshots")
46+
else
47+
Some("Releases" at nexus + "service/local/staging/deploy/maven2")
48+
}
49+
)

project/plugins.sbt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
resolvers += Resolver.sonatypeRepo("snapshots")
2-
addSbtPlugin("org.scala-exercises" % "sbt-exercise" % "0.3.0-SNAPSHOT", "0.13", "2.10")
2+
addSbtPlugin("org.scala-exercises" % "sbt-exercise" % "0.3.0-SNAPSHOT", "0.13", "2.10")
3+
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0")

pubring.gpg

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
-----BEGIN PGP PUBLIC KEY BLOCK-----
2+
Version: BCPG v1.51
3+
4+
mQENBFgGJjoBCACkQzvPI+1VtMYz252a3i3wm1dKrsF5v/E//IsYLMsXx/4BICES
5+
bjZchmCbaIqjaNrfBxRAR20KbWVXbUptDJgXA/WOyGEUfDvS6Kfm1F6A34qVyCIr
6+
NPEIeDVM64nLpQFrNuIiFPlTj9eXbKPRbV0eUrtKH59iplB4DCboK4ysGX3Hk/A3
7+
nzmAf9+Lt9N8vuzO8ymYvdWfdzQsVPCSXkKhK2qpT+ORIPAPWGdXmZ6Rr1wAGwqY
8+
+x0iVSL2IFs5MqDvBbDoyfnt14UVffJlI6O0C+flIY+kSCp86pYQrHHaCnWrnALU
9+
L8Cb/DJ7DODpd99bDHtkuMHUn4BO4WmoI69zABEBAAG0JXNjYWxhLWV4ZXJjaXNl
10+
cyA8ZGV2ZWxvcGVyQDQ3ZGVnLmNvbT6JARwEEwECAAYFAlgGJjoACgkQT9ktcdDT
11+
ZI66CQgAkGDi0EOapqJbFMiNTH85IelGs2c04aNPnEGZh+dUHqpJvA785PduXtzT
12+
XEP8DVP4zgjfGoDyiaJWBVXyg6Ch7XZ6gNodgOS7oQu5nFsA6ZBtwVy0qfRjfK2E
13+
NEIvRuNjQuAlDTDHRfDtZmFIDSd4YR/smJL7BVrO5eT+qsbeluZGGi54TY/zwLbe
14+
TefcUmTixDhm5LGyVPKiEdZwk6o385+9IAFycFozb9K/1NSTBM1GbZBMR/WuACbT
15+
K+DDtqUnGk1cZmNbWzoVabNnubVhGnhMC9AW24pzHu+xEk13yXsPWVikB6NbVg50
16+
TBkuFf9IEXMEzanKMDDMOatih3a8bg==
17+
=fR5S
18+
-----END PGP PUBLIC KEY BLOCK-----

secring.gpg.enc

1.81 KB
Binary file not shown.

0 commit comments

Comments
 (0)