Skip to content

Commit 2d0d569

Browse files
authored
Merge pull request #15 from scala-exercises/autorelease
Settings for automatic release
2 parents 97851f2 + 7ae58b5 commit 2d0d569

File tree

4 files changed

+30
-1
lines changed

4 files changed

+30
-1
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,7 @@ bin/
3030

3131
# OSX
3232
.DS_Store
33+
34+
# PGP keys
35+
pubring.gpg
36+
secring.gpg

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,6 @@ jdk:
66
script:
77
- git clone https://github.com/scala-exercises/site.git site
88
- pushd site; sbt 'definitions/publishLocal' 'runtime/publishLocal' 'compiler/publishLocal' 'sbt-exercise/publishLocal' ; popd
9-
- sbt test
9+
- sbt test
10+
after_success:
11+
- bash deploy.sh

deploy.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/sh
2+
3+
function decipherKeys {
4+
echo $KEYS_PASSPHRASE | gpg --passphrase-fd 0 keys.tar.gpg
5+
tar xfv keys.tar
6+
}
7+
8+
function publish {
9+
sbt compile publishSigned
10+
}
11+
12+
function release {
13+
decipherKeys
14+
publish
15+
}
16+
17+
if [[ $TRAVIS_BRANCH == 'master' ]]; then
18+
echo "Master branch, releasing..."
19+
release
20+
else
21+
echo "Not in master branch, skipping release"
22+
fi
23+

keys.tar.gpg

2.81 KB
Binary file not shown.

0 commit comments

Comments
 (0)