forked from cardano-foundation/cardano-wallet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
108 lines (94 loc) · 5.43 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
# Use small container and not VM:
sudo: false
# Choose a build environment:
dist: focal
# 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:
# Upload swagger to bump.sh
- gem install bump-cli
- sudo snap install yq
- yq eval specifications/api/swagger.yaml -j > specifications/api/swagger.json
- bump validate --doc $BUMP_SH_DOC_ID --token $BUMP_SH_TOKEN specifications/api/swagger.json
- bump deploy --doc $BUMP_SH_DOC_ID --token $BUMP_SH_TOKEN specifications/api/swagger.json
# 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
# 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"
- "mkdir -p auto-completion auto-completion/bash auto-completion/zsh auto-completion/fish"
- "./cardano-wallet-linux64/cardano-wallet --bash-completion-script cardano-wallet > auto-completion/bash/cardano-wallet.sh"
- "./cardano-wallet-linux64/cardano-wallet --zsh-completion-script cardano-wallet > auto-completion/zsh/_cardano-wallet"
- "./cardano-wallet-linux64/cardano-wallet --fish-completion-script cardano-wallet > auto-completion/fish/cardano-wallet.fish"
- "cp -r auto-completion cardano-wallet-linux64"
- "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"
- "cp -r auto-completion 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"
# 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-wallet-$TRAVIS_TAG-linux64.tar.gz
- cardano-wallet-$TRAVIS_TAG-macos64.tar.gz
- cardano-wallet-$TRAVIS_TAG-win64.zip
on:
repo: input-output-hk/cardano-wallet
branch: master
tags: true # Only release when a tag is pushed