Skip to content

Commit

Permalink
Merge pull request #102 from finagle/vk/autoreleases
Browse files Browse the repository at this point in the history
Enable Autoreleases
  • Loading branch information
leonmaia authored Nov 29, 2018
2 parents 464ea49 + 2023724 commit 72cec6f
Show file tree
Hide file tree
Showing 10 changed files with 73 additions and 24 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ target
.cache
logging.properties
.DS_Store
local.*
34 changes: 11 additions & 23 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,20 @@
dist: trusty
language: scala

scala:
- 2.11.12
- 2.12.4

jdk:
- oraclejdk8

- oraclejdk8
addons:
postgresql: "9.5"

postgresql: '9.5'
services:
- postgresql

sbt_args: -J-Xmx4096M

- postgresql
sbt_args: "-J-Xmx4096M"
env:
matrix:
- PG_HOST_PORT=127.0.0.1:5432 PG_USER=postgres PG_DBNAME=finagle_postgres_test

global:
secure: BlDBBTkjweJybkNnWvLCv8GHhoJXuTvdOmehPwppCOjHKM8z9WDgy5RabrZew/Iptlcnz7Gn4dPrQDtsWPTSY7e791gRcdGPyMX1qR5Rk9YAVnhU2ndV/Udxlabn05CFaciKtQXMF9L2oX5FbqiW2D5J2w0lKVHHr95nGZXRH1g=
before_script:
- createdb -U postgres finagle_postgres_test
- psql -U postgres -c "CREATE EXTENSION IF NOT EXISTS hstore" finagle_postgres_test
- psql -U postgres -c "CREATE EXTENSION IF NOT EXISTS citext" finagle_postgres_test

- createdb -U postgres finagle_postgres_test
- psql -U postgres -c "CREATE EXTENSION IF NOT EXISTS hstore" finagle_postgres_test
- psql -U postgres -c "CREATE EXTENSION IF NOT EXISTS citext" finagle_postgres_test
script:
- sbt ++$TRAVIS_SCALA_VERSION coverage test

after_success:
- sbt coveralls

- "./build/build.sh"
23 changes: 22 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import ReleaseTransformations._

lazy val buildSettings = Seq(
organization := "io.github.finagle",
version := "0.8.2",
scalaVersion := "2.12.4",
crossScalaVersions := Seq("2.11.12","2.12.4"),
fork in Test := true
Expand Down Expand Up @@ -30,6 +30,10 @@ lazy val publishSettings = Seq(
Some("releases" at nexus + "service/local/staging/deploy/maven2")
},
publishArtifact in Test := false,
pgpSecretRing := file("local.secring.gpg"),
pgpPublicRing := file("local.pubring.gpg"),
releasePublishArtifactsAction := PgpKeys.publishSigned.value,
releaseIgnoreUntrackedFiles := true,
licenses := Seq("Apache 2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
homepage := Some(url("https://finagle.github.io/finagle-postgres")),
autoAPIMappings := true,
Expand All @@ -39,6 +43,23 @@ lazy val publishSettings = Seq(
"scm:git:git@github.com:finagle/finagle-postgres.git"
)
),
releaseVersionBump := sbtrelease.Version.Bump.Minor,
releaseProcess := {
Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
releaseStepCommandAndRemaining("+clean"),
releaseStepCommandAndRemaining("+test"),
setReleaseVersion,
commitReleaseVersion,
tagRelease,
releaseStepCommandAndRemaining("+publishSigned"),
setNextVersion,
commitNextVersion,
releaseStepCommand("sonatypeReleaseAll"),
pushChanges
)
},
pomExtra :=
<developers>
<developer>
Expand Down
36 changes: 36 additions & 0 deletions build/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env bash
set -e

SBT_CMD="sbt +coverage +test"

if [[ "${TRAVIS_PULL_REQUEST}" == "false" ]]; then
SBT_CMD+=" +coverageOff +publish"
openssl aes-256-cbc -pass env:ENCRYPTION_PASSWORD -in ./build/secring.gpg.enc -out local.secring.gpg -d
openssl aes-256-cbc -pass env:ENCRYPTION_PASSWORD -in ./build/pubring.gpg.enc -out local.pubring.gpg -d
openssl aes-256-cbc -pass env:ENCRYPTION_PASSWORD -in ./build/credentials.sbt.enc -out local.credentials.sbt -d
openssl aes-256-cbc -pass env:ENCRYPTION_PASSWORD -in ./build/deploy_key.pem.enc -out local.deploy_key.pem -d

if [[ "${TRAVIS_BRANCH}" == "master" && $(cat version.sbt) != *"SNAPSHOT"* ]]; then
eval "$(ssh-agent -s)"
chmod 600 local.deploy_key.pem
ssh-add local.deploy_key.pem
git config --global user.name "Finch CI"
git config --global user.email "ci@kostyukov.net"
git remote set-url origin git@github.com:finagle/finagle-postgres.git
git checkout master || git checkout -b master
git reset --hard origin/master

echo 'Performing a release'
sbt 'release cross with-defaults'
elif [[ "${TRAVIS_BRANCH}" == "master" ]]; then
echo 'Master build'
${SBT_CMD}
else
echo 'Branch build'
printf 'version in ThisBuild := "%s-SNAPSHOT"' "${TRAVIS_BRANCH}" > version.sbt
${SBT_CMD}
fi
else
echo 'PR build'
${SBT_CMD}
fi
1 change: 1 addition & 0 deletions build/credentials.sbt.enc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Salted__-e(�w)Yy� �s(�3p�+�b�0�l���ݱ����~�/��C*lB��b�a���?�}AZF��7��-����߷�q�"�1�D����ٷ4����I(D��mh����cn���DA�|&/���i�Fm�+�#h3�1�u=�nZ�YrR>fs��!�)�3A��L�r3j�� ��fE5�x0T�yknyM�[�im��bS6�>)��L�t�s�.��A�K2 �81=�_n�oBX�%9 �
Expand Down
Binary file added build/deploy_key.pem.enc
Binary file not shown.
Binary file added build/pubring.gpg.enc
Binary file not shown.
Binary file added build/secring.gpg.enc
Binary file not shown.
1 change: 1 addition & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ resolvers ++= Seq(
)

addSbtPlugin("org.tpolecat" % "tut-plugin" % "0.6.9")
addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.10")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.1")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.2")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1")
Expand Down
1 change: 1 addition & 0 deletions version.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
version in ThisBuild := "0.8.3-SNAPSHOT"

0 comments on commit 72cec6f

Please sign in to comment.