diff options
Diffstat (limited to 'ci')
-rwxr-xr-x | ci/on-master.py | 10 | ||||
-rwxr-xr-x | ci/release.py | 36 | ||||
-rwxr-xr-x | ci/release.sh | 18 |
3 files changed, 28 insertions, 36 deletions
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 |