Permalink
Browse files

Tag-based publishing to Sonatype

  • Loading branch information...
szeiger committed May 3, 2017
1 parent 1ad8272 commit 79698f91a021f778c9370ab46e49a11da4d4a428
Showing with 70 additions and 11 deletions.
  1. +5 −1 .gitignore
  2. +3 −2 .travis.yml
  3. +23 −0 admin/build.sh
  4. +3 −0 admin/publish-settings.sbt
  5. +18 −0 admin/pubring.asc
  6. +16 −8 project/Build.scala
  7. +2 −0 project/build.sbt
  8. BIN secrets.tar.enc
View
@@ -19,4 +19,8 @@ lib
*.autosave
src/sphinx/capabilities.csv
slick/src/sphinx/capabilities.csv
doc/capabilities.md
doc/capabilities.md
/sonatype.sbt
/admin/secring.asc
/secrets.tar
/publish-settings.sbt
View
@@ -8,6 +8,8 @@ before_install:
- docker version
- sh -v travis/runcontainer.sh oracle db2
- docker ps
- openssl aes-256-cbc -K $encrypted_c3c0a1170361_key -iv $encrypted_c3c0a1170361_iv
-in secrets.tar.enc -out secrets.tar -d
jdk:
- oraclejdk8
notifications:
@@ -22,12 +24,11 @@ addons:
apt:
packages:
- graphviz
- python-sphinx
- mysql-server-5.6
- mysql-client-core-5.6
- mysql-client-5.6
script:
- sbt -jvm-opts jvmopts.travis -Dslick.testkit-config=test-dbs/testkit.travis.conf clean +testAll
- admin/build.sh
cache:
directories:
- $HOME/.sbt
View
@@ -0,0 +1,23 @@
#!/bin/bash
# Setup:
# - Copy keys to admin/secring.asc, admin/pubring.asc
# - Use a new key pair per repository
# - cp ~/.sbt/sonatype.sbt ./
# - tar cvf secrets.tar admin/secring.asc sonatype.sbt
# - travis encrypt-file secrets.tar --add
# - rm sonatype.sbt admin/secring.asc secrets.tar
# - Set passphrase in admin/publish-settings.sbt
set -e
if [[ "$TRAVIS_TAG" =~ ^v[0-9]+\.[0-9]+(\.[0-9]+)?(-[A-Za-z0-9-]+)? ]]; then
echo "Going to release from tag $TRAVIS_TAG!"
myVer=$(echo $TRAVIS_TAG | sed -e s/^v//)
publishVersion='set every version := "'$myVer'"'
extraTarget="+publishSigned"
cp admin/publish-settings.sbt ./
tar xf secrets.tar
fi
sbt -jvm-opts jvmopts.travis -Dslick.testkit-config=test-dbs/testkit.travis.conf "$publishVersion" +testAll $extraTarget
@@ -0,0 +1,3 @@
pgpPublicRing := file("admin/pubring.asc")
pgpSecretRing := file("admin/secring.asc")
pgpPassphrase := Some("12345".toArray)
View
@@ -0,0 +1,18 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: BCPG v1.51
mQENBFkJv28BCACMMXoGsh/rSGriNsP9as/sjbc+Nxu0wAcpXawwToe6OcbrUYN+
MPwAal9Z8PmHRUV5Zvsc6y2vaWmnZc3mYsGc1hKOpPZBfnZqGrpD3gTnbnJEJPji
xeSXLAewu/83NtH7PViCBMGqvMTfVl11pcR/boowmiYANT3pi+j8nspBDBkWNE4g
Z8aBiqmgHtSh0wR09gQXOn3JfrQ+onzj7pbK0Gvyhf/seoWALQcem5GMJ1ArEPRv
99cZNNQUQ8To9qf07rtufVhIlM1n/5xR+KVAkdn/o6KdPkv+uTJg7RXxYh1Y9xml
XyX0KNLOr3ypiydeQxGlxv/1n+5bBJcni4rPABEBAAG0MVNsaWNrIENJIFB1Ymxp
c2hpbmcgPHN6ZWlnZXIxK3NsaWNrLWNpQGdtYWlsLmNvbT6JARwEEwECAAYFAlkJ
v28ACgkQbVFiBAJcVazUCQgAg7bV6u4AASbfbuS1IrjoGLwmEg+lQne10C/U6ja6
t41l4HdsEfhVVlOG17Gell32VI9LVA4soIK5vrBlhl/jbPmiHxCDOteNOjVBs2fO
oXTiFSOEJR6d7o1X5kQrUWMYlZ9jrSnFdVQqYPHPGdiB8F/5qvf0UTFgfzAJCGV9
WGkgGPUqyAtkyubo2Wbn8T5wtZ+wpx1ThhrzgXLmu1+J8X3Lb1NwtAB7E2wTiQHy
MvHI8bJN+u729TvyiKZMnODjkoFR9G9jneHiIhO8UAfF8DTbKnhNiScsYrneoGrP
pNrEGR/c4Jl5inboIYCfZ0yFGIdEv+Y+WNxbacVx8rI+5w==
=Dm4r
-----END PGP PUBLIC KEY BLOCK-----
View
@@ -6,6 +6,7 @@ import com.typesafe.tools.mima.plugin.MimaKeys.{mimaPreviousArtifacts, mimaBinar
import com.typesafe.tools.mima.core.{ProblemFilters, MissingClassProblem}
import com.typesafe.sbt.osgi.SbtOsgi.{osgiSettings, OsgiKeys}
import com.typesafe.sbt.sdlc.Plugin._
import com.typesafe.sbt.pgp.PgpKeys
import com.novocode.ornate.sbtplugin.OrnatePlugin
import com.novocode.ornate.sbtplugin.OrnatePlugin.autoImport._
@@ -95,6 +96,9 @@ object SlickBuild extends Build {
val makeSite = TaskKey[Unit]("makeSite")
def versionTag(v: String) = // get the tag for a version
"v" + v
lazy val sharedSettings = Seq(
version := slickVersion,
organizationName := "Typesafe",
@@ -106,7 +110,7 @@ object SlickBuild extends Build {
"-doc-version", version.value,
"-doc-footer", "Slick is developed by Typesafe and EPFL Lausanne.",
"-sourcepath", (sourceDirectory in Compile).value.getPath, // needed for scaladoc to strip the location of the linked source path
"-doc-source-url", s"https://github.com/slick/slick/blob/${version.value}/slick/src/main€{FILE_PATH}.scala",
"-doc-source-url", s"https://github.com/slick/slick/blob/${versionTag(version.value)}/slick/src/main€{FILE_PATH}.scala",
"-implicits",
"-diagrams", // requires graphviz
"-groups"
@@ -186,6 +190,10 @@ object SlickBuild extends Build {
settings = Defaults.coreDefaultSettings ++ sharedSettings ++ extTarget("root") ++ Seq(
sourceDirectory := file("target/root-src"),
publishArtifact := false,
publish := {},
publishLocal := {},
PgpKeys.publishSigned := {},
PgpKeys.publishLocalSigned := {},
test := (), testOnly := (), // suppress test status output
commands += testAll,
ornateBaseDir := Some(file("doc")),
@@ -196,8 +204,8 @@ object SlickBuild extends Build {
ornateSettings := Map(
"version" -> version.value,
"shortVersion" -> version.value.replaceFirst("""(\d*.\d*).*""", """$1"""),
"tag" -> version.value, // for snippet links
"branch" -> "master", // for "Edit page" links
"tag" -> versionTag(version.value), // for snippet links
"branch" -> "3.2", // for "Edit page" links
"scalaVersion" -> scalaVersion.value // for "scalaapi:" links
),
ornate := (ornate dependsOn (buildCapabilitiesTable in slickTestkitProject)).value,
@@ -225,11 +233,11 @@ object SlickBuild extends Build {
description := "Scala Language-Integrated Connection Kit",
libraryDependencies ++= Dependencies.mainDependencies,
scalacOptions in (Compile, doc) ++= Seq(
"-doc-source-url", s"https://github.com/slick/slick/blob/${version.value}/slick/src/main€{FILE_PATH}.scala",
"-doc-source-url", s"https://github.com/slick/slick/blob/${versionTag(version.value)}/slick/src/main€{FILE_PATH}.scala",
"-doc-root-content", "scaladoc-root.txt"
),
test := (), testOnly := (), // suppress test status output
mimaPreviousArtifacts := Set("com.typesafe.slick" % ("slick_" + scalaBinaryVersion.value) % binaryCompatSlickVersion),
mimaPreviousArtifacts := Set("com.typesafe.slick" % ("slick_" + scalaBinaryVersion.value) % binaryCompatSlickVersion),
mimaBinaryIssueFilters ++= Seq(
ProblemFilters.exclude[MissingClassProblem]("slick.util.MacroSupportInterpolationImpl$"),
ProblemFilters.exclude[MissingClassProblem]("slick.util.MacroSupportInterpolationImpl")
@@ -267,7 +275,7 @@ object SlickBuild extends Build {
name := "Slick-TestKit",
description := "Test Kit for Slick (Scala Language-Integrated Connection Kit)",
scalacOptions in (Compile, doc) ++= Seq(
"-doc-source-url", s"https://github.com/slick/slick/blob/${version.value}/slick-testkit/src/main€{FILE_PATH}.scala"
"-doc-source-url", s"https://github.com/slick/slick/blob/${versionTag(version.value)}/slick-testkit/src/main€{FILE_PATH}.scala"
),
testOptions += Tests.Argument(TestFrameworks.JUnit, "-q", "-v", "-s", "-a", "-Djava.awt.headless=true"),
//scalacOptions in Compile += "-Yreify-copypaste",
@@ -309,7 +317,7 @@ object SlickBuild extends Build {
name := "Slick-CodeGen",
description := "Code Generator for Slick (Scala Language-Integrated Connection Kit)",
scalacOptions in (Compile, doc) ++= Seq(
"-doc-source-url", s"https://github.com/slick/slick/blob/${version.value}/slick-codegen/src/main€{FILE_PATH}.scala"
"-doc-source-url", s"https://github.com/slick/slick/blob/${versionTag(version.value)}/slick-codegen/src/main€{FILE_PATH}.scala"
),
unmanagedResourceDirectories in Test += (baseDirectory in aRootProject).value / "common-test-resources",
test := (), testOnly := () // suppress test status output
@@ -321,7 +329,7 @@ object SlickBuild extends Build {
name := "Slick-HikariCP",
description := "HikariCP integration for Slick (Scala Language-Integrated Connection Kit)",
scalacOptions in (Compile, doc) ++= Seq(
"-doc-source-url", s"https://github.com/slick/slick/blob/${version.value}/slick-hikaricp/src/main€{FILE_PATH}.scala"
"-doc-source-url", s"https://github.com/slick/slick/blob/${versionTag(version.value)}/slick-hikaricp/src/main€{FILE_PATH}.scala"
),
libraryDependencies += Dependencies.hikariCP,
test := (), testOnly := (), // suppress test status output
View
@@ -13,3 +13,5 @@ addSbtPlugin("de.johoop" % "sbt-testng-plugin" % "3.0.2")
resolvers += Resolver.url("fix-sbt-plugin-releases", url("https://dl.bintray.com/sbt/sbt-plugin-releases"))(Resolver.ivyStylePatterns)
addSbtPlugin("com.novocode" % "sbt-ornate" % "0.4")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0")
View
Binary file not shown.

0 comments on commit 79698f9

Please sign in to comment.