-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
45 lines (35 loc) · 1.36 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# run tests, build release, build readme, commit results back into /dist/ directory
language: node_js
node_js:
- node
if: commit_message !~ /^Deploy\s/ # prevent deployment re-triggering the build
deploy:
provider: pages
github_token: $GITHUB_TOKEN
target_branch: master
skip_cleanup: true
keep_history: true
allow_empty_commit: false
local_dir: .
on:
branch: master
script:
- mkdir -p ./dist
- rm -rf ./dist/*
- sourceFilename='galkontinuum-debug.user.js'
- releaseFilename='galkontinuum.user.js'
# run tests:
- node "./$sourceFilename" run-unittests 'null'
- |
argJson="{\
\"commitId\" : \"$TRAVIS_COMMIT\",\
\"filename\" : \"$releaseFilename\",\
\"homepageHref\" : \"https://github.com/$TRAVIS_REPO_SLUG/tree/$TRAVIS_BRANCH/#readme\",\
\"downloadHref\" : \"https://github.com/$TRAVIS_REPO_SLUG/raw/$TRAVIS_BRANCH/dist/$releaseFilename\"}"
# generate manifest.json:
- node "./$sourceFilename" create-manifest "$argJson" > ./dist/manifest.json
# generate release mode userscript:
- node "./$sourceFilename" create-release "$argJson" > "./dist/$releaseFilename"
# generate documentation:
- echo "[![Build Status](https://travis-ci.com/$TRAVIS_REPO_SLUG.svg?branch=$TRAVIS_BRANCH)](https://travis-ci.com/$TRAVIS_REPO_SLUG)" > ./README.md
- node "./$sourceFilename" create-readme "$argJson" >> ./README.md