Skip to content

Commit ae5f642

Browse files
Merge branch 'master' into key-members-validation
2 parents cf9fed8 + 9785fe7 commit ae5f642

File tree

3 files changed

+38
-35
lines changed

3 files changed

+38
-35
lines changed

.releaserc.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
11
branch: master
2-
publishConfig:
3-
# FIXME this does not work
4-
tag: next

.travis.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@ language: node_js
22
node_js:
33
- lts/*
44

5-
branches:
6-
only:
7-
- master
8-
- /^greenkeeper/.*$/
9-
105
cache:
116
directories:
127
- $HOME/.npm

tools/gh-pages-publish.ts

Lines changed: 38 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,42 @@
1-
const { cd, exec, echo, touch } = require("shelljs")
2-
const { readFileSync } = require("fs")
3-
const url = require("url")
1+
const { cd, exec, echo, touch } = require('shelljs')
2+
const { readFileSync } = require('fs')
3+
const url = require('url')
44

5-
let repoUrl
6-
let pkg = JSON.parse(readFileSync("package.json") as any)
7-
if (typeof pkg.repository === "object") {
8-
if (!pkg.repository.hasOwnProperty("url")) {
9-
throw new Error("URL does not exist in repository section")
10-
}
11-
repoUrl = pkg.repository.url
12-
} else {
13-
repoUrl = pkg.repository
5+
const info = {
6+
TRAVIS_BRANCH: process.env.TRAVIS_BRANCH,
7+
TRAVIS_PULL_REQUEST: process.env.TRAVIS_PULL_REQUEST,
8+
TRAVIS_PULL_REQUEST_BRANCH: process.env.TRAVIS_PULL_REQUEST_BRANCH,
149
}
10+
echo(`running on branch ${JSON.stringify(info)}`)
11+
12+
if (info.TRAVIS_BRANCH === 'master' && info.TRAVIS_PULL_REQUEST === 'false') {
13+
const pkg = JSON.parse(readFileSync('package.json') as any)
14+
let repoUrl
15+
if (typeof pkg.repository === 'object') {
16+
if (!pkg.repository.hasOwnProperty('url')) {
17+
throw new Error('URL does not exist in repository section')
18+
}
19+
repoUrl = pkg.repository.url
20+
} else {
21+
repoUrl = pkg.repository
22+
}
1523

16-
let parsedUrl = url.parse(repoUrl)
17-
let repository = (parsedUrl.host || "") + (parsedUrl.path || "")
18-
let ghToken = process.env.GH_TOKEN
24+
const parsedUrl = url.parse(repoUrl)
25+
const repository = (parsedUrl.host || '') + (parsedUrl.path || '')
26+
const ghToken = process.env.GH_TOKEN
1927

20-
echo("Deploying docs!!!")
21-
cd("dist/docs")
22-
touch(".nojekyll")
23-
exec("git init")
24-
exec("git add .")
25-
exec('git config user.name "Michael Wittwer"')
26-
exec('git config user.email "[email protected]"')
27-
exec('git commit -m "docs(docs): update gh-pages"')
28-
exec(
29-
`git push --force --quiet "https://${ghToken}@${repository}" master:gh-pages`
30-
)
31-
echo("Docs deployed!!")
28+
echo('Deploying docs!!!')
29+
cd('dist/docs')
30+
touch('.nojekyll')
31+
exec('git init')
32+
exec('git add .')
33+
exec('git config user.name "Michael Wittwer"')
34+
exec('git config user.email "[email protected]"')
35+
exec('git commit -m "docs(docs): update gh-pages"')
36+
exec(
37+
`git push --force --quiet "https://${ghToken}@${repository}" master:gh-pages`
38+
)
39+
echo('Docs deployed!!')
40+
} else {
41+
echo('Not running on master -> skipping docs deployment')
42+
}

0 commit comments

Comments
 (0)