diff options
-rw-r--r-- | .travis.yml | 8 | ||||
-rwxr-xr-x | build.sc | 18 | ||||
-rwxr-xr-x | ci/release.sh | 9 | ||||
-rwxr-xr-x | ci/test-mill-built.sh (renamed from ci/test3.sh) | 0 | ||||
-rwxr-xr-x | ci/test-mill-release.sh (renamed from ci/test4.sh) | 0 | ||||
-rwxr-xr-x | ci/test-sbt-built.sh (renamed from ci/test2.sh) | 0 | ||||
-rwxr-xr-x | ci/test-sbt.sh (renamed from ci/test1.sh) | 0 | ||||
-rw-r--r-- | core/test/src/mill/util/ScriptTestSuite.scala | 4 | ||||
-rw-r--r-- | core/test/src/mill/util/TestEvaluator.scala | 4 |
9 files changed, 31 insertions, 12 deletions
diff --git a/.travis.yml b/.travis.yml index 02d43def..da939589 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,13 +11,13 @@ jdk: matrix: include: - stage: build - env: CI_SCRIPT=ci/test1.sh + env: CI_SCRIPT=ci/test-sbt.sh - stage: build - env: CI_SCRIPT=ci/test2.sh + env: CI_SCRIPT=ci/test-sbt-built.sh - stage: build - env: CI_SCRIPT=ci/test3.sh + env: CI_SCRIPT=ci/test-mill-built.sh - stage: build - env: CI_SCRIPT=ci/test4.sh + env: CI_SCRIPT=ci/test-mill-release.sh - stage: release env: CI_SCRIPT=ci/release.sh @@ -243,7 +243,23 @@ def uploadToGithub(assembly: Path, authKey: String, release: String, label: Stri } } -def releaseCI(githubAuthKey: String, sonatypeCreds: String, gpgPassphrase: String) = +def releaseCI(githubAuthKey: String, + sonatypeCreds: String, + gpgPassphrase: String, + gpgPrivateKey: String) = + if (isMasterCommit) T.command() + else { + write(home / "gpg.key", java.util.Base64.getDecoder.decode(gpgPrivateKey)) + %('gpg, 'import, home / "gpg.key")(pwd) + T.command{ + releaseManual(githubAuthKey, sonatypeCreds, gpgPassphrase)() + } + } + + +def releaseManual(githubAuthKey: String, + sonatypeCreds: String, + gpgPassphrase: String) = if (isMasterCommit) T.command() else T.command{ moduledefs.publish(sonatypeCreds, gpgPassphrase)() diff --git a/ci/release.sh b/ci/release.sh index 892e8e49..18bfc399 100755 --- a/ci/release.sh +++ b/ci/release.sh @@ -2,7 +2,10 @@ set -eux -echo $GPG_PRIVATE_KEY_B64 | base64 --decode > ~/gpg.key -gpg import ~/gpg.key -target/bin/mill releaseCI $GITHUB_ACCESS_TOKEN lihaoyi:$SONATYPE_PASSWORD $GPG_PASSWORD + +target/bin/mill releaseCI \ + $GITHUB_ACCESS_TOKEN \ + lihaoyi:$SONATYPE_PASSWORD \ + $GPG_PASSWORD \ + $GPG_PRIVATE_KEY_B64 diff --git a/ci/test3.sh b/ci/test-mill-built.sh index 5b3b1a28..5b3b1a28 100755 --- a/ci/test3.sh +++ b/ci/test-mill-built.sh diff --git a/ci/test4.sh b/ci/test-mill-release.sh index 52fc053d..52fc053d 100755 --- a/ci/test4.sh +++ b/ci/test-mill-release.sh diff --git a/ci/test2.sh b/ci/test-sbt-built.sh index ebb3ddb5..ebb3ddb5 100755 --- a/ci/test2.sh +++ b/ci/test-sbt-built.sh diff --git a/ci/test1.sh b/ci/test-sbt.sh index f77456f7..f77456f7 100755 --- a/ci/test1.sh +++ b/ci/test-sbt.sh diff --git a/core/test/src/mill/util/ScriptTestSuite.scala b/core/test/src/mill/util/ScriptTestSuite.scala index 7d46feee..1aa74de1 100644 --- a/core/test/src/mill/util/ScriptTestSuite.scala +++ b/core/test/src/mill/util/ScriptTestSuite.scala @@ -11,8 +11,8 @@ abstract class ScriptTestSuite extends TestSuite{ def scriptSourcePath: Path val workspacePath = pwd / 'target / 'workspace / workspaceSlug -// val stdOutErr = new PrintStream(new ByteArrayOutputStream()) - val stdOutErr = new PrintStream(System.out) + val stdOutErr = new PrintStream(new ByteArrayOutputStream()) +// val stdOutErr = new PrintStream(System.out) val stdIn = new ByteArrayInputStream(Array()) val runner = new mill.main.MainRunner( ammonite.main.Cli.Config(wd = workspacePath), false, diff --git a/core/test/src/mill/util/TestEvaluator.scala b/core/test/src/mill/util/TestEvaluator.scala index 92ce5b37..c9230065 100644 --- a/core/test/src/mill/util/TestEvaluator.scala +++ b/core/test/src/mill/util/TestEvaluator.scala @@ -28,8 +28,8 @@ class TestEvaluator[T <: TestUtil.TestBuild](module: T) tp: TestPath){ val outPath = TestUtil.getOutPath() -// val logger = DummyLogger - val logger = new PrintLogger(true, ammonite.util.Colors.Default, System.out, System.out, System.err) + val logger = DummyLogger +// val logger = new PrintLogger(true, ammonite.util.Colors.Default, System.out, System.out, System.err) val evaluator = new Evaluator(outPath, TestEvaluator.externalOutPath, module, discover, logger) def apply[T](t: Task[T]): Either[Result.Failing[T], (T, Int)] = { |