Skip to content

Commit 38563cd

Browse files
committed
Merge branch '1.0.x' into merge-1-to-2
2 parents 9ed1989 + c556b24 commit 38563cd

14 files changed

+164
-94
lines changed

.travis.yml

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,19 @@ language: scala
22

33
env:
44
global:
5-
- PUBLISH_JDK=openjdk7 # admin/build.sh only publishes when running on this jdk
6-
# Don't commit sensitive files, instead commit a version encrypted with $SECRET,
7-
# this environment variable is encrypted with this repo's private key and stored below:
8-
# (See http://docs.travis-ci.com/user/environment-variables/#Secure-Variables.)
9-
- secure: "g/d6gjq6g+t5ieI6DwOiL5k8XJ/ethlZ1ZZDA/uvOsCfkIu0MBL2cYGmwQ0gcBNBQ/02wZjXnTIgMhFhYLcgHtnicAjy+53fhjCYcTM6A61DCPhJ6txOjEEPrpnlqbvKauw0WuVGT8Kd52bhaMXPCE2GOWgPe+bJfDUTHSm86dw="
5+
- PUBLISH_JDK=oraclejdk8
6+
# PGP_PASSPHRASE
7+
- secure: "bTGw0loJcnmzNuJG3bjGLs7tfnrWlLb3oi6nBeYUS+coRhKzK4jMN6luuh89gVwIcbFK2nZUkm1s59UZzQA0SMBsdL/Js9Zi6jiUj4NBIVEOzgQxp/vlScF/kF7HxxBji6Gxp/TpqW2MOFxCtWWGBoktuAsufFEhJ47m/cVUZBY="
8+
# SONA_USER
9+
- secure: "uJEIIJGX+xviY5prNor9WW8JuV4MdQbNvGe6nO4Cwumv8LEXALlpONZrmF5BvEB7HrmB/VUqwDO9utrhN7VPaFhCTnoHuslbSdhdB9Yg/lwD+0FpszvKjjraoWeQqqJuXoml9kmH4kQBIP4RxPTnzocPHRIfVyEOYRnMtydImBA="
10+
# SONA_PASS
11+
- secure: "SlbOg79Jzzg7QQeVDu8Q+zZM/GRLFZxPjud9DsLCu4tkTVXWHcYn6FaXuOvVsLkgeALT2pM5j6Zcpp6WqyGRJiSkVqVGqM3jXWov+esgSmhu9pIMvVtxmvfiHBXofiKNYax3XCX+hTwCVuh2pEZ5Thy8i+fXVElCCqzcgTnp+DQ="
1012

11-
script:
12-
- admin/build.sh
13-
scala:
14-
- 2.11.1
15-
- 2.10.4
16-
jdk:
17-
- openjdk7
18-
- oraclejdk7
13+
script: admin/build.sh
14+
15+
jdk: oraclejdk8
1916

2017
notifications:
2118
email:
2219
2320
24-
25-
# if we get weird timeouts, see https://github.com/spray/spray/pull/233
26-
# 'set concurrentRestrictions in Global += Tags.limit(Tags.Test, 1)'

admin/README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
## Tag Driven Releasing
2+
3+
Copied from https://github.com/scala/scala-java8-compat/commit/4a6cfc97cd95227b86650410e1b632e5ff79335b.
4+
5+
### Background Reading
6+
7+
- http://docs.travis-ci.com/user/environment-variables/
8+
- http://docs.travis-ci.com/user/encryption-keys/
9+
- http://docs.travis-ci.com/user/encrypting-files/
10+
11+
### Initial setup for the repository
12+
13+
To configure tag driven releases from Travis CI.
14+
15+
1. Generate a key pair for this repository with `./admin/genKeyPair.sh`.
16+
Edit `.travis.yml` and `admin/build.sh` as prompted.
17+
2. Publish the public key to https://pgp.mit.edu
18+
3. Store other secrets as encrypted environment variables with `admin/encryptEnvVars.sh`.
19+
Edit `.travis.yml` as prompted.
20+
4. Edit `.travis.yml` to use `./admin/build.sh` as the build script,
21+
and edit that script to use the tasks required for this project.
22+
5. Edit `.travis.yml` to select which JDK will be used for publishing.
23+
24+
It is important to add comments in .travis.yml to identify the name
25+
of each environment variable encoded in a `:secure` section.
26+
27+
After all of these steps, your .travis.yml should contain config of the
28+
form:
29+
30+
language: scala
31+
env:
32+
global:
33+
- PUBLISH_JDK=openjdk6
34+
# PGP_PASSPHRASE
35+
- secure: "XXXXXX"
36+
# SONA_USER
37+
- secure: "XXXXXX"
38+
# SONA_PASS
39+
- secure: "XXXXXX"
40+
script: admin/build.sh
41+
42+
If Sonatype credentials change in the future, step 3 can be repeated
43+
without generating a new key.
44+
45+
Be sure to use SBT 0.13.7 or higher to avoid [#1430](https://github.com/sbt/sbt/issues/1430)!
46+
47+
### Testing
48+
49+
1. Follow the release process below to create a dummy release (e.g. 0.1.0-TEST1).
50+
Confirm that the release was staged to Sonatype but do not release it to Maven
51+
central. Instead, drop the staging repository.
52+
53+
### Performing a release
54+
55+
1. Create a GitHub "Release" (with a corresponding tag) via the GitHub
56+
web interface.
57+
2. Travis CI will schedule a build for this release. Review the build logs.
58+
3. Log into https://oss.sonatype.org/ and identify the staging repository.
59+
4. Sanity check its contents
60+
5. Release staging repository to Maven and send out release announcement.
61+

admin/build.sh

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/bash
22

3+
set -e
4+
35
# prep environment for publish to sonatype staging if the HEAD commit is tagged
46

57
# git on travis does not fetch tags, but we have TRAVIS_TAG
@@ -9,11 +11,15 @@ if [ "$TRAVIS_JDK_VERSION" == "$PUBLISH_JDK" ] && [[ "$TRAVIS_TAG" =~ ^v[0-9]+\.
911
echo "Going to release from tag $TRAVIS_TAG!"
1012
myVer=$(echo $TRAVIS_TAG | sed -e s/^v//)
1113
publishVersion='set every version := "'$myVer'"'
12-
extraTarget="publish-signed"
13-
14+
extraTarget="+publish-signed"
1415
cat admin/gpg.sbt >> project/plugins.sbt
15-
admin/decrypt.sh sensitive.sbt
16-
(cd admin/ && ./decrypt.sh secring.asc)
16+
cp admin/publish-settings.sbt .
17+
18+
# Copied from the output of genKeyPair.sh
19+
K=$encrypted_e923b9d88d53_key
20+
IV=$encrypted_e923b9d88d53_iv
21+
22+
openssl aes-256-cbc -K $K -iv $IV -in admin/secring.asc.enc -out admin/secring.asc -d
1723
fi
1824

19-
sbt ++$TRAVIS_SCALA_VERSION "$publishVersion" clean update compile test $extraTarget
25+
sbt "$publishVersion" clean update +test +publishLocal $extraTarget

admin/decrypt.sh

Lines changed: 0 additions & 2 deletions
This file was deleted.

admin/encrypt.sh

Lines changed: 0 additions & 2 deletions
This file was deleted.

admin/encryptAll.sh

Lines changed: 0 additions & 19 deletions
This file was deleted.

admin/encryptEnvVars.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
#
3+
# Encrypt sonatype credentials so that they can be
4+
# decrypted in trusted builds on Travis CI.
5+
#
6+
set -e
7+
8+
read -s -p 'SONA_USER: ' SONA_USER
9+
travis encrypt SONA_USER="$SONA_USER"
10+
read -s -p 'SONA_PASS: ' SONA_PASS
11+
travis encrypt SONA_PASS="$SONA_PASS"

admin/genKeyPair.sh

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/bin/bash
2+
#
3+
# Generates a key pair for this repository to sign artifacts.
4+
# Encrypt the private key and its passphrase in trusted builds
5+
# on Travis CI.
6+
#
7+
set -e
8+
9+
# Based on https://gist.github.com/kzap/5819745:
10+
function promptDelete() {
11+
if [[ -f "$1" ]]; then
12+
echo About to delete $1, Enter for okay / CTRL-C to cancel
13+
read
14+
rm "$1"
15+
fi
16+
}
17+
for f in admin/secring.asc.enc admin/secring.asc admin/pubring.asc; do promptDelete "$f"; done
18+
19+
echo Generating key pair. Please enter 1. repo name 2. [email protected], 3. a new passphrase
20+
echo Be careful when using special characters in the passphrase, see http://docs.travis-ci.com/user/encryption-keys/#Note-on-escaping-certain-symbols
21+
cp admin/gpg.sbt project
22+
sbt 'set pgpReadOnly := false' \
23+
'set pgpPublicRing := file("admin/pubring.asc")' \
24+
'set pgpSecretRing := file("admin/secring.asc")' \
25+
'pgp-cmd gen-key'
26+
rm project/gpg.sbt
27+
28+
echo ============================================================================================
29+
echo Encrypting admin/secring.asc. Update K and IV variables in admin/build.sh accordingly.
30+
echo ============================================================================================
31+
travis encrypt-file admin/secring.asc
32+
rm admin/secring.asc
33+
mv secring.asc.enc admin
34+
35+
echo ============================================================================================
36+
echo Encrypting environment variables. Add each to a line in .travis.yml. Include a comment
37+
echo with the name of the corresponding variable
38+
echo ============================================================================================
39+
read -s -p 'PGP_PASSPHRASE: ' PGP_PASSPHRASE
40+
travis encrypt PGP_PASSPHRASE="$PGP_PASSPHRASE"
41+

admin/gpg.sbt

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,2 @@
11

2-
addSbtPlugin("com.typesafe.sbt" % "sbt-pgp" % "0.8.3") // only added when publishing:
3-
4-
// There's a companion sensitive.sbt, which was created like this:
5-
//
6-
// 1. in an sbt shell that has the sbt-pgp plugin, create pgp key in admin/:
7-
//
8-
// sbt
9-
// set pgpReadOnly := false
10-
// set pgpPublicRing := file("admin/pubring.asc")
11-
// set pgpSecretRing := file("admin/secring.asc")
12-
// pgp-cmd gen-key // use $passPhrase
13-
// Please enter the name associated with the key: $repoName
14-
// Please enter the email associated with the key: [email protected]
15-
// Please enter the passphrase for the key: $passphrase
16-
//
17-
// 2. create sensitive.sbt with contents:
18-
//
19-
// pgpPassphrase := Some($passPhrase.toArray)
20-
//
21-
// pgpPublicRing := file("admin/pubring.asc")
22-
//
23-
// pgpSecretRing := file("admin/secring.asc")
24-
//
25-
// credentials += Credentials("Sonatype Nexus Repository Manager", "oss.sonatype.org", $sonaUser, $sonaPass)
26-
2+
addSbtPlugin("com.typesafe.sbt" % "sbt-pgp" % "0.8.3") // only added when publishing, see build.sh

admin/publish-settings.sbt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
def env(key: String) = Option(System.getenv(key)).getOrElse("")
2+
3+
pgpPassphrase := Some(env("PGP_PASSPHRASE").toArray)
4+
5+
pgpPublicRing := file("admin/pubring.asc")
6+
7+
pgpSecretRing := file("admin/secring.asc")
8+
9+
credentials += Credentials("Sonatype Nexus Repository Manager", "oss.sonatype.org", env("SONA_USER"), env("SONA_PASS"))

admin/pubring.asc

Lines changed: 14 additions & 14 deletions
Original file line numberD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eeRopMfADkEBkxZY6z
6+
dUUvkD8jofIczKDUWnPlBo5T0qDdYp9qfVoCLtJA80YkpREiH8itdp5CD+Jq5gCL
7+
LorXlAfv89DrqNYYkzxDkpcAhv6W5gbRmodafsjV1DMrleLKYHgPR+8zDcv36f1n
8+
KEj156DeQPHzRQDOoxZnJAT/b0bt3SfDiQJdNEnCzJh3kCvg0mejk0bKGrX8SpXg
9+
q0k0QK2p87HPQfSVdzTpWHXcDB/mTwn2cl2jABEBAAG0LnNjYWxhLXN3aW5nIDxz
10+
Y2FsYS1pbnRlcm5hbHNAZ29vZ2xlZ3JvdXBzLmNvbT6JARwEEwECAAYFAlVQyBQA
11+
CgkQ+V9S380juJxzqAf9EwtCZBz8Tokle07HyWfULWEnJniyCy7JtYh/Ajq/rP9r
12+
WKygZWmekRjfJujIqBFe7svRjPOLZ82h0ZSCvfd54dMZhNqFktRFMYLnJ4iCUF3B
13+
V5gCEhU/2h8LAyOmWTCLyhF0zFhGatbySpe4pXDElq98E80ti5iozi6sBnDxKdVy
14+
9Ngw17fDLhyflvreJG4qaYD1rmpks6NmCiL84x2kFraAuSnl0YCYfi7GIUWrUtjl
15+
PDk9Cex1o5r8NN1vijRcDpU4jD4NyF7G5/G1Qr9IB9ZZFJQbk1JLsI6v//70xI6Q
16+
C/mumWgyhJJHATA9OXTDfuT1Od0eN2E10Ez8u0mYvQ==
17+
=D3ls
1818
-----END PGP PUBLIC KEY BLOCK-----

admin/secring.asc.enc

-688 Bytes
Binary file not shown.

build.sbt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@ import com.typesafe.tools.mima.plugin.{MimaPlugin, MimaKeys}
22

33
scalaModuleSettings
44

5-
name := "scala-swing"
5+
name := "scala-swing"
66

7-
version := "2.0.0-SNAPSHOT"
7+
version := "2.0.0-SNAPSHOT"
88

9-
scalaVersion := "2.11.1"
9+
scalaVersion := crossScalaVersions.value.head
1010

11-
scalacOptions ++= Seq("-deprecation", "-feature", "-target:jvm-1.6")
11+
crossScalaVersions := Seq("2.11.6", "2.12.0-M1")
12+
13+
scalacOptions ++= Seq("-deprecation", "-feature")
1214

1315
// important!! must come here (why?)
1416
scalaModuleOsgiSettings

sensitive.sbt.enc

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)