forked from dappnode/DNP_WAMP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
67 lines (63 loc) · 1.88 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
language: node_js
dist: xenial
sudo: required
# ########################
# How to trigger a release
#
# Push a tag to origin:
# - "release" (= patch)
# - "release/patch"
# - "release/minor"
# - "release/major"
# ########################
stages:
- name: build-test
if: tag !~ /^release\/(major|minor|patch)$/
- name: release
if: tag =~ /^release\/(major|minor|patch)$/
jobs:
include:
# Test that it builds correctly
###############################
- stage: build-test
name: build-test
services:
- docker
script:
- docker-compose build
# Deploy stage
# - code below is common between DAppNode packages
##################################################
- stage: release
name: release
services:
- docker
script:
- npm install -g @dappnode/dappnodesdk
- docker-compose build
- "TYPE=${TRAVIS_TAG##*/}"
- "[ ! '$TYPE' = 'release' ] || TYPE='patch'"
- dappnodesdk publish ${TYPE} -p infura
node_js:
- "10.15.3"
before_deploy:
- wget https://raw.githubusercontent.com/dappnode/DAppNode/master/scripts/before_deploy.sh
- source before_deploy.sh
deploy:
provider: releases
prerelease: true
overwrite: true
api_key: "$GITHUB_TOKEN"
file_glob: true
# $RELEASE_VERSION is exported on before_deploy.sh
file: build_${RELEASE_VERSION}/*
skip_cleanup: true
# $TRAVIS_TAG is exported on before_deploy.sh
name: "$TRAVIS_TAG"
body: "# Changelog"
on:
tags: true
condition: "$TRAVIS_TAG = release || $TRAVIS_TAG = release/patch || $TRAVIS_TAG = release/minor || $TRAVIS_TAG = release/major"
after_deploy:
- wget https://raw.githubusercontent.com/dappnode/DAppNode/master/scripts/after_deploy.sh
- source after_deploy.sh