summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLi Haoyi <haoyi.sg@gmail.com>2018-02-17 10:48:39 -0800
committerLi Haoyi <haoyi.sg@gmail.com>2018-02-17 10:48:39 -0800
commita225e7650892ecc1e672bcaf95dff0d598682583 (patch)
tree8dc8ca425bc9d74a1002aa862a60cdbf82bacf9b
parent7f2b6e2d5015654954376639706543502a377844 (diff)
downloadmill-a225e7650892ecc1e672bcaf95dff0d598682583.tar.gz
mill-a225e7650892ecc1e672bcaf95dff0d598682583.tar.bz2
mill-a225e7650892ecc1e672bcaf95dff0d598682583.zip
extract on-master.py from release script, tweak docs
-rw-r--r--.travis.yml4
-rwxr-xr-xci/on-master.py10
-rwxr-xr-xci/release.py36
-rwxr-xr-xci/release.sh18
-rw-r--r--docs/pages/1 - Intro to Mill.md4
-rw-r--r--docs/pages/2 - Configuring Mill.md2
6 files changed, 35 insertions, 39 deletions
diff --git a/.travis.yml b/.travis.yml
index 8e4b54fb..4c9581a1 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -19,9 +19,9 @@ matrix:
- stage: build
env: CI_SCRIPT=ci/test-mill-release.sh
- stage: release
- env: CI_SCRIPT=ci/release.py
+ env: CI_SCRIPT="ci/on-master.py ci/release.py"
- stage: release
- env: CI_SCRIPT=ci/publish-docs.sh
+ env: CI_SCRIPT="ci/on-master.py ci/publish-docs.sh"
script:
- "$CI_SCRIPT"
diff --git a/ci/on-master.py b/ci/on-master.py
new file mode 100755
index 00000000..9199f56b
--- /dev/null
+++ b/ci/on-master.py
@@ -0,0 +1,10 @@
+#!/usr/bin/env python
+
+import os, sys, subprocess
+is_master_commit = (
+ os.environ["TRAVIS_PULL_REQUEST"] == "false" and
+ (os.environ["TRAVIS_BRANCH"] == "master" or os.environ["TRAVIS_TAG"] != "")
+)
+
+if is_master_commit:
+ subprocess.check_call(sys.argv[1:])
diff --git a/ci/release.py b/ci/release.py
deleted file mode 100755
index 541774f3..00000000
--- a/ci/release.py
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env python
-
-from subprocess import check_call
-import tempfile
-import os, base64
-
-is_master_commit = (
- os.environ["TRAVIS_PULL_REQUEST"] == "false" and
- (os.environ["TRAVIS_BRANCH"] == "master" or os.environ["TRAVIS_TAG"] != "")
-)
-
-if is_master_commit:
- check_call(["sbt", "bin/test:assembly"])
-
- _, tmp = tempfile.mkstemp()
-
- with open(tmp, "w") as f:
- f.write(base64.b64decode(os.environ["GPG_PRIVATE_KEY_B64"]))
-
- check_call(["gpg", "--import", tmp])
-
- check_call([
- "target/bin/mill",
- "mill.scalalib.PublishModule/publishAll",
- "lihaoyi:" + os.environ["SONATYPE_PASSWORD"],
- os.environ["GPG_PASSWORD"],
- "__.publishArtifacts"
- "--release",
- "true"
- ])
-
- check_call([
- "target/bin/mill",
- "uploadToGithub",
- os.environ["GITHUB_ACCESS_TOKEN"]
- ])
diff --git a/ci/release.sh b/ci/release.sh
new file mode 100755
index 00000000..a6a1d51e
--- /dev/null
+++ b/ci/release.sh
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+
+sbt bin/test:assembly
+
+echo $GPG_PRIVATE_KEY_B64 | base64 --decode > gpg_key
+
+gpg --import gpg_key
+
+rm gpg_key
+target/bin/mill mill.scalalib.PublishModule/publishAll \
+ lihaoyi:$SONATYPE_PASSWORD \
+ $GPG_PASSWORD \
+ __.publishArtifacts \
+ --release
+ true \
+
+
+target/bin/mill uploadToGithub $GITHUB_ACCESS_TOKEN
diff --git a/docs/pages/1 - Intro to Mill.md b/docs/pages/1 - Intro to Mill.md
index 022bc212..20fe83b8 100644
--- a/docs/pages/1 - Intro to Mill.md
+++ b/docs/pages/1 - Intro to Mill.md
@@ -181,6 +181,10 @@ $ mill --watch foo.compile
$ mill --watch foo.run
```
+Mill's `--watch` flag watches both the files you are building using Mill, as
+well as Mill's own `build.sc` file and anything it imports, so any changes to
+your `build.sc` will automatically get picked up.
+
## Command-line Tools
Mill comes built in with a small number of useful command-line utilities:
diff --git a/docs/pages/2 - Configuring Mill.md b/docs/pages/2 - Configuring Mill.md
index 8fee9354..bfe7a8db 100644
--- a/docs/pages/2 - Configuring Mill.md
+++ b/docs/pages/2 - Configuring Mill.md
@@ -264,7 +264,7 @@ object foo extends ScalaModule {
super.compile()
}
def run(args: String*) = T.command{
- println("Running... + args.mkString(" "))
+ println("Running..." + args.mkString(" "))
super.run(args:_*)
}
}