From 78b537aa8d0497304e0f9675d07da3158e13462f Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Mon, 11 May 2015 16:38:18 +0200 Subject: [PATCH 1/3] Remove current travis scripts --- .travis.yml | 16 ++-------------- admin/build.sh | 19 ------------------- admin/decrypt.sh | 2 -- admin/encrypt.sh | 2 -- admin/encryptAll.sh | 19 ------------------- admin/gpg.sbt | 21 --------------------- admin/pubring.asc | 18 ------------------ admin/secring.asc.enc | 40 ---------------------------------------- sensitive.sbt.enc | 7 ------- 9 files changed, 2 insertions(+), 142 deletions(-) delete mode 100755 admin/build.sh delete mode 100755 admin/decrypt.sh delete mode 100755 admin/encrypt.sh delete mode 100755 admin/encryptAll.sh delete mode 100644 admin/gpg.sbt delete mode 100644 admin/pubring.asc delete mode 100644 admin/secring.asc.enc delete mode 100644 sensitive.sbt.enc diff --git a/.travis.yml b/.travis.yml index c37a04c2..8ddf4761 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,24 +1,12 @@ language: scala -env: - global: - - PUBLISH_JDK=openjdk6 # admin/build.sh only publishes when running on this jdk -# Don't commit sensitive files, instead commit a version encrypted with $SECRET, -# this environment variable is encrypted with this repo's private key and stored below: -# (See http://docs.travis-ci.com/user/environment-variables/#Secure-Variables.) - - secure: ZEAhn8ozGqcQxvJD7/G3ifou2Vl7OkNzUXM15aKy0FbqLMOzsx3hAKsWEM6e/6d/7phDkiZisers+HOlt3nLwu75M3QLGm5lo4moJJJyx17omlrBQ7+M/hu3ZxqNRCE8oNI41V3pc+ZJQsY1qA7at4NPJbnAXx9sUUO2lGmc4xI= +script: sbt clean update test publishLocal -script: - - admin/build.sh -scala: - - 2.11.6 jdk: - openjdk6 - openjdk7 + notifications: email: - adriaan.moors@typesafe.com - antoine@gourlay.fr - -# if we get weird timeouts, see https://github.com/spray/spray/pull/233 -# 'set concurrentRestrictions in Global += Tags.limit(Tags.Test, 1)' diff --git a/admin/build.sh b/admin/build.sh deleted file mode 100755 index 3c7f4b6c..00000000 --- a/admin/build.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -# prep environment for publish to sonatype staging if the HEAD commit is tagged - -# git on travis does not fetch tags, but we have TRAVIS_TAG -# headTag=$(git describe --exact-match ||:) - -if [ "$TRAVIS_JDK_VERSION" == "$PUBLISH_JDK" ] && [[ "$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="publish-signed" - - cat admin/gpg.sbt >> project/plugins.sbt - admin/decrypt.sh sensitive.sbt - (cd admin/ && ./decrypt.sh secring.asc) -fi - -sbt ++$TRAVIS_SCALA_VERSION "$publishVersion" clean update compile test $extraTarget \ No newline at end of file diff --git a/admin/decrypt.sh b/admin/decrypt.sh deleted file mode 100755 index 3c3c602f..00000000 --- a/admin/decrypt.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -openssl aes-256-cbc -pass "pass:$SECRET" -in $1.enc -out $1 -d -a \ No newline at end of file diff --git a/admin/encrypt.sh b/admin/encrypt.sh deleted file mode 100755 index 4bf6c932..00000000 --- a/admin/encrypt.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -openssl aes-256-cbc -pass "pass:$SECRET" -in $1 -out $1.enc -a \ No newline at end of file diff --git a/admin/encryptAll.sh b/admin/encryptAll.sh deleted file mode 100755 index de7016b7..00000000 --- a/admin/encryptAll.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -# Based on https://gist.github.com/kzap/5819745: - -echo "This will encrypt the cleartext sensitive.sbt and admin/secring.asc, while making the encrypted versions available for decryption on Travis." -echo "Update your .travis.yml as directed, and delete the cleartext versions." -echo "Press enter to continue." -read - -# 1. create a secret, put it in an environment variable while encrypting files -- UNSET IT AFTER -export SECRET=$(cat /dev/urandom | head -c 10000 | openssl sha1) - -# 2. add the "secure: ..." line under the env section -- generate it with `` (install the travis gem first) -travis encrypt SECRET=$SECRET - -admin/encrypt.sh admin/secring.asc -admin/encrypt.sh sensitive.sbt - -echo "Remember to rm sensitive.sbt admin/secring.asc -- once you do, they cannot be recovered (except on Travis)!" \ No newline at end of file diff --git a/admin/gpg.sbt b/admin/gpg.sbt deleted file mode 100644 index 6ec4213e..00000000 --- a/admin/gpg.sbt +++ /dev/null @@ -1,21 +0,0 @@ -// only added when publishing: -addSbtPlugin("com.typesafe.sbt" % "sbt-pgp" % "0.8.3") - -/* There's a companion sensitive.sbt, which was created like this: - -1. in an sbt shell when sbt-gpg is loaded, create pgp key in admin/: - - set pgpReadOnly := false - pgp-cmd gen-key // use $passPhrase - pgp-cmd send-key hkp://keyserver.ubuntu.com - -2. create sensitive.sbt with contents: - -pgpPassphrase := Some($passPhrase.toArray) - -pgpPublicRing := file("admin/pubring.asc") - -pgpSecretRing := file("admin/secring.asc") - -credentials += Credentials("Sonatype Nexus Repository Manager", "oss.sonatype.org", $sonaUser, $sonaPass) -*/ diff --git a/admin/pubring.asc b/admin/pubring.asc deleted file mode 100644 index b750e6f9..00000000 --- a/admin/pubring.asc +++ /dev/null @@ -1,18 +0,0 @@ ------BEGIN PGP PUBLIC KEY BLOCK----- -Version: BCPG v1.49 - -mQENBFSAu20BCACAHC5KEbSM7Dm9+ksU12Y7TIP4rLLg94e/jF29WFNnH8P4rTv/ -8WNX0OF9gNW5Ltj7IzGGkzLX3HjrEKA7SEaFyTqoCQ+FIlqNNYt8YCScMyTSfYbQ -8GOEBUEcS8HPpZoudX7T1IYIAApl46kD0H4zzPPz2QHu51uj4jyjnIGRcDmHat3q -dIeBzdnGinRFY+h/b4elKI0uEAFe/WmrMb9GpUaparkbNwutwof+7gIs5N7wyamg -tErARSBgs00JJtgh+lyRv7y6T9OkL8p8nylxRGjIpUM3cICBZLTg/mA1+FPvQzFm -AvYQ3cLWeFLobIVjuKSxWKwybdxR6ikCZd/LABEBAAG0O3NjYWxhLXBhcnNlci1j -b21iaW5hdG9ycyA8c2NhbGEtaW50ZXJuYWxzQGdvb2dsZWdyb3Vwcy5jb20+iQEc -BBMBAgAGBQJUgLttAAoJEF2pklhwFz7lp+kH/21ydQFQKdIv91iUNkwdbRbFcOoY -1LTZBAg2QaWMgqo9ZqZako09IlHouzMs+8mpgu3iC0spuzt24dn0He7ruKbnUb9F -AvWcyG5Kzw/zy/wvC8IZNtLqMP5RKOJmNZydoMj2DUcfPnldAwKd/UGmOyn4AEvW -ND0Qi59mPcJy/mCCDyjYfu+tJQCRg2DEhKtNX06GskZTaBeuqEVt58ZdE2aAq/X0 -2afs/Pv160NvbzgQ5vroamvwr2Q8E5aCiCcf7DZDyG5Kibt2Z7IvrosdAJsS75xQ -Q+1w7E3af7EdVZicMjkRPEhTbrtOInCRslIfKGp221mNvl7Au/ztfGPMUKY= -=/HZD ------END PGP PUBLIC KEY BLOCK----- diff --git a/admin/secring.asc.enc b/admin/secring.asc.enc deleted file mode 100644 index 9acbd239..00000000 --- a/admin/secring.asc.enc +++ /dev/null @@ -1,40 +0,0 @@ -U2FsdGVkX1+FQtnDY5zEKGLoxEcz97shUP9GlOVy7SAuYt3TpxaZGRPhXNK/jWDZ -BQ6AcQq1cgIcn9skFDvRPsA9lRotD9wCZkc5GaGmrKgtdfccHh+58s1C8ufoL6L2 -ujZ4+W8KuwrYcOYevpykKcWfgmZ5RglKm5wUZaJq/khVIp4BmeeXEN7vk6oovZym -ymlFWhFQJDVgNs2zS6pSJD4vnndbc801nV63KZvk86RAD1vBCUKD7OfwqYpg5iCZ -dsMSkCaos+v1lBfHZDwtR0CDTrcg0gwXs3hDG5aX9PstZ/r1r8AXCjqaYtp130Ee -fkpuDA4cPMC0tPAPGAhFbBuieMEaHwZevMo9VQyykYkA841U++GgXfcRjn/IacnH -y1eqs+74JY1CZJzsLmDzGlAT3fHKVBjMnQS1KNZdDRfzC+2UyO/2dbkuGwSlw4aX -sOKz4RFwjNGbd6FUCM90ua/nsyrBlKHfuyeyllL7Q/H10zyaPvetoCpICH3852TZ -l2jnPfMrfxqpBPkDyMclRmo3uz4/zHPHwZatddNo4l7plIQHAi3cviPoZm1ncgCC -t8/O2fVFx0ubfrMKc8xqMwZBllmdTW63gP61j1vv8Xb5ZBDwpJSI4ff04SygEk2s -9Qzhx5f5izCu2+jJDsLH79d+wUeNtl+MXo78zw7lHl9rLb3+Y6L9OIgX15PBIYZx -mQ1oAXAhWK8I8NfpmdHkKSQMQ0Ls8stwVpJGvGUosIyU2COTuJfFWH0GQl8X0jSN -eNHdpthhoYHjwwlvxeGUcUJ11zbP55zCDJLxxCDOZ8lZVf9qqIk4wpquMGXoLpyQ -xIgqG/FTMlNJG5hAR3cJfFCDfjKw/Sza5Uc/BGvnRILxrqELbzgSsluL3AarpgIn -TWyx1Wc8N9Z8vA9XRaDPwh5Xv9uACw6DA37XfVeBoWCht6It0w2UyefjxWMhwmgL -GwS6/Ul6uf5jXGWlkuAlBt4t3XMynBzZJ5GXBLPzTDGzHGgRsi1jmtxOGoxXqv1O -xIXAkOjup5hLYG0B2Zz7yCottBaD9wBULIlFA1ixmNXHwxiaU95v+3jlAaOjYT1A -+QjYr6KZMM/6Jqz5gWhupRghxHx0g1m/xCEexPy4hSm4+g6TTFOx3eVj1sqUd/bV -TnbPUje3lKyXBhmfDNoFOi1VSpe8/PASakqkQqysN30zyXm76rhBrX9X5+DjQb8w -yeaYWZMAEripWGqGC9SyEadAV98elfJO/V/iK1AFZo62Ukl8VZ1OUz50P+8Brvvg -XTG8cvZYF4XTRtGTzQbDghJeyprGB0XY5SS08tms/DiPDklR9bJWzHu3lIh2EIfT -YXBWyKowZ50ih1yi4qXrABJickVLq6SKZ+Mg5X8Q/njxt+Hw9i2Cll7uoHVmGkeY -Nmoy8c3Qa3XTvGnzoMWYLKNz6oTyt/EJihHXkwzZKLgL5tOXnywwpemkTX1XXbIH -OBzz+m6MsWGbE1e57vCsP/c4zzEZ3dM6541WzZOzNdh61uS/XuHWXaBoyKKOH7BN -rXBa5BtDmU9EBQG3eBbl1Juj41mtRtUjSXu5VSWy18mKWtbvsFUC/WTFTF/8+kzd -1Sop8Oy35lb/BHYR+B8IOM/MHIIN+xhmJHlhh3Jah6hsADyRGgocQWceSJX8OQuw -JclveZ8CzSsttW7cB5hlnUp/bRrm99W9cHLda62Q3K1i3l7IyNx43IYFY+yDgnFB -crkFUizItIhYdeB//9NwcIZtM6B+3uDU/zeORhZ83FZnFdcI3u6Lfy4NWRPbecAq -wVkSu6h5xkc6E0mFGbB2228lpOQX6TZBQKP4XeQas1GHMuatFtQy+NCOdzYnW9eT -qTyU+Oku3wAt4uMxIZubZaGAd06WUg5r7L/HmcEavdkT0DHOvzYGTK0yNrlap0yp -jbCPMLXtnXT2HR1jvE483fcfBu3L7+b9R5Tz/VbqV0bEswkmjOHsz+3qUxOL3EFv -9VWrC6Q7aGm93dxAhzek1C+/UQaN9LO9jC+V9gMftJxVfwNt7syv36fV1ww/IyFX -G6HBCeyQ0KBT01/UWSI9JCKL0VP44UamvRos7+8MESuTD/BDHJlEQNxL7Teyw2Tf -xqUcjGzHevqjWJjdEelfBUl/sq8LcqfedDvzJo07sN3lqcZBdGiiyOOqnfUiJdU2 -fuOy3PljALpjvIzgqV1Y6jDiszhl7fwRn91KkWLejZiu/vx0UcwCnWQ1aPMnOydp -F12MSEqgIHpebxJFOv3tYPoUEKqGX1iATlsvTPxRD6RufGnm+pDQoKGf8qn8jfjx -Q666NYVNysJtmN15PxUAjEiJuKhXuLmtwsuhxsaSxpi+M7/k9vmtkliX4+N+XK7H -7VreF04kgzZN0qdzht2AGhoehDqdotkYb5aXqTlEzuv4MF4zVOZQHDQ6A7M6n0Z4 -RgQbhngngdMKHT5brKZm7Atlm1zOtAAexEA+ib6WfaJ0tRAQqJcsKhc7OnYXp8SU -D+cqJqvdRIEQTNuMrwzEBiW9RldYeEsgUBYMoyX4HxQ= diff --git a/sensitive.sbt.enc b/sensitive.sbt.enc deleted file mode 100644 index b3ebdac2..00000000 --- a/sensitive.sbt.enc +++ /dev/null @@ -1,7 +0,0 @@ -U2FsdGVkX19ymDGvEeR3Ld7K7e4jzUoCqTw/KfHdPdtZbPDpAc1txKP1i2y8T6hO -y4QJTEhmKXsIJEnDTjyM0wEzh/yYjdE6fGNF43cW4ysSeSEBPy104gNhQXKsyohH -JIb0suQ288cP8kZ9IBq/osXkWU0qe+++PJNMeUATaU+ek/z9f/YfvcWZ2jJIKvIk -aRMYX/Tpkm70ap9Ko9bdDsgV0/OrPnWT7It0ITIK4P7uj+Yyl9AYBRMT1sk0vqfX -oiArljvbeswaS+Ydll4u+kp/hgPMbE1IeYtmey2m9ls6FyLn+D9AfEIpUKg011K2 -kVEU678T3LqTqzJvvYhRfDR+KNw/n4l1EPj/JTubMx4qZLmDkoE69o19/lNffrCj -6B1nj4/2VU79kG+XpXDXEw== From 34bbdaa03e7e57a6572caed45eda30ba6e913812 Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Mon, 11 May 2015 16:47:27 +0200 Subject: [PATCH 2/3] Tag-driven publishing, v2 Scripts taken from here: https://github.com/scala/scala-java8-compat/commit/4a6cfc97cd95227b86650410e1b632e5ff79335b New keys generated as described in the README. --- .travis.yml | 12 +++++++- admin/README.md | 61 +++++++++++++++++++++++++++++++++++++ admin/build.sh | 25 +++++++++++++++ admin/encryptEnvVars.sh | 11 +++++++ admin/genKeyPair.sh | 41 +++++++++++++++++++++++++ admin/gpg.sbt | 2 ++ admin/publish-settings.sbt | 9 ++++++ admin/pubring.asc | 18 +++++++++++ admin/secring.asc.enc | Bin 0 -> 1888 bytes 9 files changed, 178 insertions(+), 1 deletion(-) create mode 100644 admin/README.md create mode 100755 admin/build.sh create mode 100755 admin/encryptEnvVars.sh create mode 100755 admin/genKeyPair.sh create mode 100644 admin/gpg.sbt create mode 100644 admin/publish-settings.sbt create mode 100644 admin/pubring.asc create mode 100644 admin/secring.asc.enc diff --git a/.travis.yml b/.travis.yml index 8ddf4761..5633424f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,16 @@ language: scala -script: sbt clean update test publishLocal +env: + global: + - PUBLISH_JDK=openjdk6 + # PGP_PASSPHRASE + - secure: "SkBtn/6OjEldoikn0MFuyeLT/pau27kwKSDYTVQeJ4BKDzdWLwLE5Q3RukLGttIfNdhOvRoocpQSW9GkZfibTHmwrRnAokucfZCqTsKbwoOp1xIoOh5GrrVrB6gcP7WBTKinqFdBgSvLOrP7GviImz4ZuB9wq1r+mToGG4pDrXc=" + # SONA_USER + - secure: "JSv/Er6q1XtTpRH1bpU63YBf7ufwg0vW+Kv/udQBtr8YX/P3gRYC1x6hW4uwftaKMYh7wXDkfNy51SRpH3kUptdJvjPUifVElyPiYlsumetmD+rZJmxX6agx+U5pdjIXPqPoton9MdSVHNTROeTu339bDak0Z+N5ht5wRfjP7F4=" + # SONA_PASS + - secure: "OIVtcj7AHZr8Grpf03ZmZsygcADewiYIvSnRwLYCx+5AqOzs39EZ68DsIOxi7wEXVUbVj5RvLXpKzLX3iN+UszLOQRoFPFQyyn+3Y50f8T2aRxdZtInzXn0sCVTj4Hhd/zbKl1W+2Nh3Sqazab7tFoQVzEyYqhcPeiNRMF7h+aY=" + +script: admin/build.sh jdk: - openjdk6 diff --git a/admin/README.md b/admin/README.md new file mode 100644 index 00000000..55ae9c8a --- /dev/null +++ b/admin/README.md @@ -0,0 +1,61 @@ +## Tag Driven Releasing + +Copied from https://github.com/scala/scala-java8-compat/commit/4a6cfc97cd95227b86650410e1b632e5ff79335b. + +### Background Reading + + - http://docs.travis-ci.com/user/environment-variables/ + - http://docs.travis-ci.com/user/encryption-keys/ + - http://docs.travis-ci.com/user/encrypting-files/ + +### Initial setup for the repository + +To configure tag driven releases from Travis CI. + + 1. Generate a key pair for this repository with `./admin/genKeyPair.sh`. + Edit `.travis.yml` and `admin/build.sh` as prompted. + 2. Publish the public key to https://pgp.mit.edu + 3. Store other secrets as encrypted environment variables with `admin/encryptEnvVars.sh`. + Edit `.travis.yml` as prompted. + 4. Edit `.travis.yml` to use `./admin/build.sh` as the build script, + and edit that script to use the tasks required for this project. + 5. Edit `.travis.yml` to select which JDK will be used for publishing. + +It is important to add comments in .travis.yml to identify the name +of each environment variable encoded in a `:secure` section. + +After all of these steps, your .travis.yml should contain config of the +form: + + language: scala + env: + global: + - PUBLISH_JDK=openjdk6 + # PGP_PASSPHRASE + - secure: "XXXXXX" + # SONA_USER + - secure: "XXXXXX" + # SONA_PASS + - secure: "XXXXXX" + script: admin/build.sh + +If Sonatype credentials change in the future, step 3 can be repeated +without generating a new key. + +Be sure to use SBT 0.13.7 or higher to avoid [#1430](https://github.com/sbt/sbt/issues/1430)! + +### Testing + + 1. Follow the release process below to create a dummy release (e.g. 0.1.0-TEST1). + Confirm that the release was staged to Sonatype but do not release it to Maven + central. Instead, drop the staging repository. + +### Performing a release + + 1. Create a GitHub "Release" (with a corresponding tag) via the GitHub + web interface. + 2. Travis CI will schedule a build for this release. Review the build logs. + 3. Log into https://oss.sonatype.org/ and identify the staging repository. + 4. Sanity check its contents + 5. Release staging repository to Maven and send out release announcement. + diff --git a/admin/build.sh b/admin/build.sh new file mode 100755 index 00000000..99016954 --- /dev/null +++ b/admin/build.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +set -e + +# prep environment for publish to sonatype staging if the HEAD commit is tagged + +# git on travis does not fetch tags, but we have TRAVIS_TAG +# headTag=$(git describe --exact-match ||:) + +if [ "$TRAVIS_JDK_VERSION" == "$PUBLISH_JDK" ] && [[ "$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="publish-signed" + cat admin/gpg.sbt >> project/plugins.sbt + cp admin/publish-settings.sbt . + + # Copied from the output of genKeyPair.sh + K=$encrypted_5e972ec514e2_key + IV=$encrypted_5e972ec514e2_iv + + openssl aes-256-cbc -K $K -iv $IV -in admin/secring.asc.enc -out admin/secring.asc -d +fi + +sbt "$publishVersion" clean update test publishLocal $extraTarget diff --git a/admin/encryptEnvVars.sh b/admin/encryptEnvVars.sh new file mode 100755 index 00000000..b6256679 --- /dev/null +++ b/admin/encryptEnvVars.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# +# Encrypt sonatype credentials so that they can be +# decrypted in trusted builds on Travis CI. +# +set -e + +read -s -p 'SONA_USER: ' SONA_USER +travis encrypt SONA_USER="$SONA_USER" +read -s -p 'SONA_PASS: ' SONA_PASS +travis encrypt SONA_PASS="$SONA_PASS" diff --git a/admin/genKeyPair.sh b/admin/genKeyPair.sh new file mode 100755 index 00000000..17db3f39 --- /dev/null +++ b/admin/genKeyPair.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# +# Generates a key pair for this repository to sign artifacts. +# Encrypt the private key and its passphrase in trusted builds +# on Travis CI. +# +set -e + +# Based on https://gist.github.com/kzap/5819745: +function promptDelete() { + if [[ -f "$1" ]]; then + echo About to delete $1, Enter for okay / CTRL-C to cancel + read + rm "$1" + fi +} +for f in admin/secring.asc.enc admin/secring.asc admin/pubring.asc; do promptDelete "$f"; done + +echo Generating key pair. Please enter 1. repo name 2. scala-internals@googlegroups.com, 3. a new passphrase +echo Be careful when using special characters in the passphrase, see http://docs.travis-ci.com/user/encryption-keys/#Note-on-escaping-certain-symbols +cp admin/gpg.sbt project +sbt 'set pgpReadOnly := false' \ + 'set pgpPublicRing := file("admin/pubring.asc")' \ + 'set pgpSecretRing := file("admin/secring.asc")' \ + 'pgp-cmd gen-key' +rm project/gpg.sbt + +echo ============================================================================================ +echo Encrypting admin/secring.asc. Update K and IV variables in admin/build.sh accordingly. +echo ============================================================================================ +travis encrypt-file admin/secring.asc +rm admin/secring.asc +mv secring.asc.enc admin + +echo ============================================================================================ +echo Encrypting environment variables. Add each to a line in .travis.yml. Include a comment +echo with the name of the corresponding variable +echo ============================================================================================ +read -s -p 'PGP_PASSPHRASE: ' PGP_PASSPHRASE +travis encrypt PGP_PASSPHRASE="$PGP_PASSPHRASE" + diff --git a/admin/gpg.sbt b/admin/gpg.sbt new file mode 100644 index 00000000..68ae4641 --- /dev/null +++ b/admin/gpg.sbt @@ -0,0 +1,2 @@ + +addSbtPlugin("com.typesafe.sbt" % "sbt-pgp" % "0.8.3") // only added when publishing, see build.sh diff --git a/admin/publish-settings.sbt b/admin/publish-settings.sbt new file mode 100644 index 00000000..f763ea06 --- /dev/null +++ b/admin/publish-settings.sbt @@ -0,0 +1,9 @@ +def env(key: String) = Option(System.getenv(key)).getOrElse("") + +pgpPassphrase := Some(env("PGP_PASSPHRASE").toArray) + +pgpPublicRing := file("admin/pubring.asc") + +pgpSecretRing := file("admin/secring.asc") + +credentials += Credentials("Sonatype Nexus Repository Manager", "oss.sonatype.org", env("SONA_USER"), env("SONA_PASS")) diff --git a/admin/pubring.asc b/admin/pubring.asc new file mode 100644 index 00000000..f6c13e89 --- /dev/null +++ b/admin/pubring.asc @@ -0,0 +1,18 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: BCPG v1.49 + +mQENBFVQwAoBCACr9atY5vDPbvYEMO8D4OvBz/YTP/tr43S/ibYIL2SAAZXvoVht +5BRAw063HqeM74U58isdbrt33VfmmJSJ0lVJX3iJ6dJeRO66az4aiqUckDP1JyVx +S3PJc402PcnF2Is849DHJF8AutIiAVnXa+gD5j/BShA6UZek9LqM9SRIl0SwE4Xo +WfMGdfvgQFl2vKJohrUbpKIYnhPa4HEu9FUFjVWn4iemeUVZ5OWzfEWNymrWDdLC +q5j1YMfjVvrtT3DhQD+HnDM4l5FNFxl7DHJkeMZZl+pp6RxS++m+/xMK5WmGj2Un +JUKzdoXGJdBA2q3erk5Dq6++ivvLqABt2J8DABEBAAG0O3NjYWxhLXBhcnNlci1j +b21iaW5hdG9ycyA8c2NhbGEtaW50ZXJuYWxzQGdvb2dsZWdyb3Vwcy5jb20+iQEc +BBMBAgAGBQJVUMAKAAoJEHCQr0Ol4Q0LX7MH/1GTgBitKA/RNXK04k//P9U4k7bX +ofJDUrtwx+WNg2bi2er6RQhsWPWQ3p/clgK7by93XkgDrBPLsUTIUTCHGa/Dn9R+ +h5syQfjI5iDi1AZ47ARmSZisadG6RAzLNewQUFcYwBTmGxLBrGBjcxvrmUN1XLml +jA4mqzvApDvwMrzWKdE6eNBf7G2k4dlwG4AzkSNMHfCDFXUgqsqvodrAp+WmGpbN +kZzrAVYoZtfKfalakjZDdn6EqKgw0VgZynSCX1gfwrwLric12fCBWbqXARiMVaM2 +EUqbFszdNRkD/TT9vDIabQqZvLsJO6Ql50hrOJ7IPoEmxJukuS64Je/AYiM= +=iDWo +-----END PGP PUBLIC KEY BLOCK----- diff --git a/admin/secring.asc.enc b/admin/secring.asc.enc new file mode 100644 index 0000000000000000000000000000000000000000..fd45d25625dba57ae0f971e69e32ec50136123d7 GIT binary patch literal 1888 zcmV-m2cP)+)>NpOwDnBaUCsWMmIJe566=u@+-$PhisfeEhHM2$B+bh@EL&0yT1poc|I{ zS)ebRfc;v|$Em#1upq!rfnu8Au(*|wK+AvEYgwooxJ-Y@mgT|vZs|$XOK~MS&)v&hFu(CH=CmuXjlsZ3XL&`KA=7&*hrebIt>&!7drJC8z^K(8JJ zkN|+W3MNORV>^nX^gp^L#&iKpO(p@BoAOO#k&TTV8y`lus2{M-R2Y?Z`#B6_uJYM6 zHE*F}!h}~w_4XnsJ6sEai6nN>rP<2`6xYG~>bM3{!-=z5Z8obt9W<$zF|LqVzoJ9& zAP4z~5^DQc(-7A6$Z~sVf=AFp`IfFEyGTIlIO;T2{njjFI9cO63%C9wn4(|y`uyMm$Qjvgd%jE!-O zaaQT(+}COX=eMFx21DRDrp595xmdl{i&-UM1kOTRR%?~JpvV>ZN5gox%q8IFd)U&? zMHZsyU)LAwjJ6B(iJdJ10&1z+1MB~OF}y&a?`CAQ4ZT2WpUDrMAr?d%td+`~-?8^z zUf%6iJsV8eG!Aa;&aYHnqG5fH4-=k1*zpoa+rUjgVhPNTjJQ`xlt|7X09+uH5E;gB zQwv3DVC2?0(S{Mqk7Z<_QS|xFhp(Br;C0+PBMFaFbR^Hx1ha#}tpqIE)SqEVT*uXKB->wsKXzQ7 zah^>_2@bpoQX#s%^Mn^pf{C)sK}*DdUxZ!0^p{r#FAs{NR~{o%M$^*k&-rYk zY^k2C#-qyF`C>c^JHgi`Y8>dK7ps+4yd}@Qe{0dy?1<(vSlut5xI5G@RA9{4ZkzEk zdRJ`Tp^+T9M&_u>5@}jJHN?y*=<2AUWnTc9c>|276b*qU#LxRIA_7}ng2pz9IBPu& zFof|=)v9u{_p}GqAU+G;bahvX23@g4zOx*t>6Q)mBsfMxB(drh&Yv)iGz_v^$JuZ@ngC zgVWI}hZke&+O2Tjb5pbk!C-RwnatXT;D|4 z72tE3*q24<|B<{N!<~iFgc`9?@nli}inEKfbp6c1^SW-`F*v({Y>J~67f~w5E3-!G zu;I@azC9ZLJLM?uWxoYBuCcpgw}#LSc^J6KCryZ1Nt^a1cq-0$A8O4brzg*cw<2^| z?kTwV>q;GHJ-4&phqfl70P8NX5FRkL$@xI$PR<$S-mR-sB;Rf?&%$n!Rla7ib$X4P ztG2z-?@U0B*Ut2-iN;(jjdq$|(A#iPuJbenhgFOG?QE4iQnk8flAjU^P9JZ6VSaH> z!|jbzPSZ3GLx_QMcEaH@+$t{Jua1Nsf!qC@HmgO0{(PMsWhO{U_w1Nnfe!MR-yo?i ak)wR%3r_F~Ewj!$!0y^z;?)DNF0T2uSiS@R literal 0 HcmV?d00001 From acb60c6eed14b86724262e35eee7de9268b7f154 Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Mon, 11 May 2015 16:49:17 +0200 Subject: [PATCH 3/3] cross-build with 2.11 and 2.12 --- admin/build.sh | 4 ++-- build.sbt | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/admin/build.sh b/admin/build.sh index 99016954..ddd6d5e0 100755 --- a/admin/build.sh +++ b/admin/build.sh @@ -11,7 +11,7 @@ if [ "$TRAVIS_JDK_VERSION" == "$PUBLISH_JDK" ] && [[ "$TRAVIS_TAG" =~ ^v[0-9]+\. echo "Going to release from tag $TRAVIS_TAG!" myVer=$(echo $TRAVIS_TAG | sed -e s/^v//) publishVersion='set every version := "'$myVer'"' - extraTarget="publish-signed" + extraTarget="+publish-signed" cat admin/gpg.sbt >> project/plugins.sbt cp admin/publish-settings.sbt . @@ -22,4 +22,4 @@ if [ "$TRAVIS_JDK_VERSION" == "$PUBLISH_JDK" ] && [[ "$TRAVIS_TAG" =~ ^v[0-9]+\. openssl aes-256-cbc -K $K -iv $IV -in admin/secring.asc.enc -out admin/secring.asc -d fi -sbt "$publishVersion" clean update test publishLocal $extraTarget +sbt "$publishVersion" clean update +test +publishLocal $extraTarget diff --git a/build.sbt b/build.sbt index c9209e22..6a5a6f29 100644 --- a/build.sbt +++ b/build.sbt @@ -6,7 +6,9 @@ name := "scala-parser-combinators" version := "1.0.5-SNAPSHOT" -scalaVersion := "2.11.6" +scalaVersion := crossScalaVersions.value.head + +crossScalaVersions := Seq("2.11.6", "2.12.0-M1") // important!! must come here (why?) scalaModuleOsgiSettings