Skip to content

Commit f20a6f3

Browse files
committed
build: create release from travis
1 parent 29a5ccb commit f20a6f3

File tree

3 files changed

+51
-11
lines changed

3 files changed

+51
-11
lines changed

.travis.yml

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,40 @@
1+
conditions: v1
2+
sudo: required
3+
dist: xenial
14
language: node_js
25
node_js:
3-
- 0.8
6+
- '12'
47

5-
before_script:
8+
addons:
9+
chrome: stable
10+
11+
services:
12+
- xvfb
13+
cache:
14+
directories:
15+
- node_modules
16+
17+
before_install:
618
- export DISPLAY=:99.0
7-
- sh -e /etc/init.d/xvfb start
8-
- npm install --quiet -g karma
9-
- ./scripts/web-server.js > /dev/null &
10-
- sleep 1 # give server time to start
11-
12-
script:
13-
- karma start config/karma.conf.js --no-auto-watch --single-run --reporters=dots --browsers=Firefox
14-
- karma start config/karma-e2e.conf.js --reporters=dots --browsers=Firefox
19+
- chmod +x ./scripts/travis.sh
20+
21+
script: ./scripts/travis.sh
22+
23+
stages:
24+
- Release
25+
26+
jobs:
27+
fast_finish: true
28+
include:
29+
# https://docs.travis-ci.com/user/build-stages/deploy-github-releases/
30+
- stage: Release
31+
name: 'Releasing a new version'
32+
if: tag IS present
33+
deploy:
34+
- provider: releases
35+
api_key: $GH_TOKEN
36+
file_glob: true
37+
file: _dist/*.zip
38+
skip_cleanup: true
39+
on:
40+
tags: true

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232
"grunt-contrib-watch": "~0.5.3"
3333
},
3434
"scripts": {
35-
"test": "echo \"Error: no test specified\" && exit 1"
35+
"test": "echo \"Error: no test specified\" && exit 1",
36+
"build": "grunt && npm run create:zip",
37+
"create:zip": "cd _dist && zip -r studio_$TAG.zip ."
3638
},
3739
"repository": {
3840
"type": "git",

scripts/travis.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/sh
2+
# https://docs.travis-ci.com/user/customizing-the-build/#Implementing-Complex-Build-Steps
3+
set -ev
4+
npm install grunt
5+
if [ "${TRAVIS_MODE}" = "release" ]; then
6+
echo "Building..."
7+
TAG=$TRAVIS_TAG yarn run build
8+
echo "Finish building"
9+
else
10+
echo "Unknown travis mode: ${TRAVIS_MODE}" 1>&2
11+
exit 1
12+
fi

0 commit comments

Comments
 (0)