-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path.travis.yml
87 lines (82 loc) · 2.89 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
jobs:
# Build in parallel
include:
- os: osx
osx_image: xcode10.2
language: node_js
node_js: "12"
env:
- ELECTRON_CACHE=$HOME/.cache/electron
- ELECTRON_BUILDER_CACHE=$HOME/.cache/electron-builder
script:
# Use 0.0.0 as TRAVIS_TAG if no tag was pushed; used in deploy section
# Update version in package.json
- >
[ -n "$TRAVIS_TAG" ] && (cd app && npm version $TRAVIS_TAG) || export TRAVIS_TAG=0.0.0
- echo Current Tag is $TRAVIS_TAG
# Update DevTag 0.0.0 to current master branch
- >
[ "$TRAVIS_TAG" == "0.0.0" ]
&& git pull --tags
&& git tag -f $TRAVIS_TAG
&& git push -f https://$GH_TOKEN@github.com/$TRAVIS_REPO_SLUG.git $TRAVIS_TAG
|| true
# Build
- (cd ui && npm ci && npm run build)
- (cd app && npm ci && npm run tsc && npm run electron:build -- -m)
- (cd app && node scripts/make-node-pkg.js) ;
# npm deploy (not using travis deploy cause of different conditions)
- >
if [ "$TRAVIS_TAG" != "0.0.0" ] ; then
cd builds/asksin-analyzer-xs-*-node ;
npm set //registry.npmjs.org/:_authToken $NPM_API_TOKEN ;
npm publish ;
cd ..
rm -rf asksin-analyzer-xs-*-node
cd .. ;
fi
- os: linux
services: docker
language: generic
before_cache:
- rm -rf $HOME/.cache/electron-builder/wine
script:
- >
[ -n "$TRAVIS_TAG" ] && (cd app && npm version $TRAVIS_TAG) || export TRAVIS_TAG=0.0.0
- >
docker run --rm
--env GH_TOKEN=$GH_TOKEN --env VUE_APP_COMMIT_HASH=$VUE_APP_COMMIT_HASH --env TRAVIS_TAG=$TRAVIS_TAG
-v ${PWD}:/project
-v ~/.cache/electron:/root/.cache/electron
-v ~/.cache/electron-builder:/root/.cache/electron-builder
electronuserland/builder:wine
/bin/bash -c "
echo Current Tag is $TRAVIS_TAG &&
[ $TRAVIS_TAG != 0.0.0 ] && (cd app && npm version $TRAVIS_TAG) || true &&
echo Current Tag is $TRAVIS_TAG Commit Hash is $VUE_APP_COMMIT_HASH &&
(cd ui && npm ci && npm run build) &&
(cd app && npm ci && npm run tsc && npm run electron:build -- -lw) &&
chown -R $UID /root/.cache/electron*
"
before_script:
- export VUE_APP_COMMIT_HASH=$(git log --pretty=format:'%h' -n 1)
# Create Github Release / Update Assets for existing releases
deploy:
provider: releases
token: $GH_TOKEN
overwrite: true
file_glob: true
file: $TRAVIS_BUILD_DIR/builds/asksin-analyzer-xs-*.*
skip_cleanup: true
on:
all_branches: true
cache:
directories:
- app/node_modules
- ui/node_modules
- $HOME/.cache/electron
- $HOME/.cache/electron-builder
# Prevent build loop when re-tagging 0.0.0
branches:
except:
- "0.0.0"