forked from cardano-foundation/cardano-wallet
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
130 lines (111 loc) · 6.39 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# Use small container and not VM:
sudo: false
# Choose a build environment:
dist: xenial
# Only clone the repository tip & track all branches
git:
depth: false
notifications:
slack:
rooms:
secure: VYkYJktT9Cu/aRGQccZrFdjqgFZKq65k5CIMF3i2QmMfwXVzgFojY2XyRP+VB/idopI3iAtMz81dHXUBNyX50JtftFRL4R3ic+7eqDJu30E9kerjDbFeveISVLLTTTvuG13sME6UclgKycF9Cma68Q9+MqSxCMNnu1X8LvqKofZLG2xy9UMUzJx39a9D/+oyQUtpNRopxxvG9bpyOoOp9H+lJLlDiiBpNea07l0r+9XlgfbM1UiqdxBuZMzbWoOE2QKv+JBj1PrHyS0LNwnbM6k6VNx0BWMa3C9NSnvKp7vF0aOSR9UslCjAcE/eg8xzNu/A/xNhgxF30Uc4rzH99E7f4z+G4/Qure2p+Y+jz0IBtsmLDfHWwEL2BPyaqTbMwEJz8oYKYYrb9UtjYLvn4LtbgtwAqqDgbdpMlS5pB5P/klblDsR3YsKkLwYPfZeAKXyLfMMuVpEILE7nS9ntyjw5I6tCK23PryeuJQad34C7iFQXeC42WvgYV5x+F+ZbFaY58GdVWER5X66yp4Jxgo2uo0tCdjpN8PlgQOjDSl7tgMBFcLu+TXhpYZQ1Kr/nV2f2Nb2+MDs5Eb/05yTeZzNBMzMLbKNZcAJgP3kyAAgnkUuDaVYLUcZ2q5CJkokWLWTg6fLzcoNZ1kdmtU14FwOuj0sczO42AiAqYP4EOls=
on_pull_requests: false
on_success: change # Send a Slack notification when the build goes from failed to success (and vice-versa)
on_error: always # Send a Slack notification when the build is failing on master
email: false
# We use a hybrid setup with Rust and Haskell, so we handle the compilation ourselves
language: generic
# Deactivate builds on branches but `master` and the bors branches.
# CI is still triggered by PRs).
# We do also CI to kick in when pushing a tag `git push --tags` for releases.
if: "(branch = master) OR (tag =~ /^v(2019|2020|2021)-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/)"
# Define custom set of stages
stages:
- documentation 📚
- deploy 🚀
jobs:
fast_finish: true
include:
- stage: documentation 📚
if: type != pull_request AND (branch = master OR tag =~ ^v)
name: "API Documentation"
script:
- mkdir -p api/edge
- cp -Rv specifications/api/* api/edge
- git checkout --orphan gh-pages-deploy && git reset
- git add api && git commit -m $TRAVIS_COMMIT
- git fetch origin
- git checkout gh-pages && git merge -X theirs --no-commit --no-ff --allow-unrelated-histories - && git commit --allow-empty --no-edit
- git push -f -q https://WilliamKingNoel-Bot:[email protected]/input-output-hk/cardano-wallet gh-pages &>/dev/null
- stage: deploy 🚀
if: type != pull_request AND (tag =~ ^v OR commit_message =~ /TRAVIS_TRIGGER_RELEASE/)
name: "Executables"
script:
# Fetch the builds from Hydra
- nvm install 12.18.3 && nvm use 12.18.3
- npm install --no-save [email protected] [email protected]
- node --tls-min-v1.2 scripts/travis-download-builds.js
############################
# cardano-node
############################
# Unpack and rename stuff for the Linux archive
- "tar xzf cardano-wallet-20*-linux64.tar.gz"
- "mv cardano-wallet-20*/ cardano-wallet-linux64"
- "./cardano-wallet-linux64/cardano-wallet version | grep -q $TRAVIS_COMMIT"
- "tar czf cardano-wallet-$TRAVIS_TAG-linux64.tar.gz cardano-wallet-linux64"
- "rm -rf cardano-wallet-linux64 cardano-wallet-20*-linux64.tar.gz"
# Unpack and rename stuff for the MacOS archive
- "tar xzf cardano-wallet-20*-macos64.tar.gz"
- "mv cardano-wallet-20*/ cardano-wallet-macos64"
- "tar czf cardano-wallet-$TRAVIS_TAG-macos64.tar.gz cardano-wallet-macos64"
- "rm -rf cardano-wallet-macos64 cardano-wallet-20*-macos64.tar.gz"
# Unpack and rename stuff for the Windows archive
- "unzip -d cardano-wallet-win64 cardano-wallet-20*-win64.zip"
- "zip -r cardano-wallet-$TRAVIS_TAG-win64.zip cardano-wallet-win64"
- "rm -rf cardano-wallet-win64 cardano-wallet-win64.zip"
############################
# jörmungandr
############################
# Unpack and rename stuff for the Linux archive
- "tar xzf cardano-wallet-jormungandr-*-linux64.tar.gz"
- "mv cardano-wallet-jormungandr-*/ cardano-wallet-jormungandr-linux64"
- "mv cardano-wallet-jormungandr-linux64/cardano-wallet-jormungandr cardano-wallet-jormungandr-linux64/cardano-wallet"
- "./cardano-wallet-jormungandr-linux64/cardano-wallet version | grep -q $TRAVIS_COMMIT"
- "tar czf cardano-wallet-itn-$TRAVIS_TAG-linux64.tar.gz cardano-wallet-jormungandr-linux64"
- "rm -rf cardano-wallet-jormungandr-linux64 cardano-wallet-jormungandr-*-linux64.tar.gz"
# Unpack and rename stuff for the MacOS archive
- "tar xzf cardano-wallet-jormungandr-*-macos64.tar.gz"
- "mv cardano-wallet-jormungandr-*/ cardano-wallet-jormungandr-macos64"
- "mv cardano-wallet-jormungandr-macos64/cardano-wallet-jormungandr cardano-wallet-jormungandr-macos64/cardano-wallet"
- "tar czf cardano-wallet-itn-$TRAVIS_TAG-macos64.tar.gz cardano-wallet-jormungandr-macos64"
- "rm -rf cardano-wallet-jormungandr-macos64 cardano-wallet-jormungandr-*-macos64.tar.gz"
# Unpack and rename stuff for the Windows archive
- "unzip -d cardano-wallet-jormungandr-win64 cardano-wallet-jormungandr-*-win64.zip"
- "mv cardano-wallet-jormungandr-win64/cardano-wallet-jormungandr.exe cardano-wallet-jormungandr-win64/cardano-wallet.exe"
- "zip -r cardano-wallet-itn-$TRAVIS_TAG-win64.zip cardano-wallet-jormungandr-win64"
- "rm -rf cardano-wallet-jormungandr-win64 cardano-wallet-jormungandr-*-win64.zip"
# Deploy documentation snapshot
- mkdir -p api/$TRAVIS_TAG
- cp -Rv specifications/api/* api/$TRAVIS_TAG
- git checkout --orphan gh-pages-deploy && git reset
- git add api && git commit -m $TRAVIS_COMMIT
- git checkout gh-pages && git merge -X theirs --no-commit --no-ff --allow-unrelated-histories - && git commit --allow-empty --no-edit
- travis_retry git push -f -q https://WilliamKingNoel-Bot:[email protected]/input-output-hk/cardano-wallet gh-pages &>/dev/null
deploy:
provider: releases
api_key: $GITHUB_ACCESS_TOKEN
draft: true # Allow editing the release before publishing it officially on GitHub
skip_cleanup: true # Make sure that files from the previous stages aren't cleaned up
file:
# cardano-node
- cardano-wallet-$TRAVIS_TAG-linux64.tar.gz
- cardano-wallet-$TRAVIS_TAG-macos64.tar.gz
- cardano-wallet-$TRAVIS_TAG-win64.zip
# Jörmungandr / ITN
- cardano-wallet-itn-$TRAVIS_TAG-linux64.tar.gz
- cardano-wallet-itn-$TRAVIS_TAG-macos64.tar.gz
- cardano-wallet-itn-$TRAVIS_TAG-win64.zip
on:
repo: input-output-hk/cardano-wallet
branch: master
tags: true # Only release when a tag is pushed