1
- version : 2
1
+ version : 2.1
2
2
jobs :
3
3
build :
4
4
docker :
5
5
- image : zondax/circleci:latest
6
6
steps :
7
7
- checkout
8
8
- run : git submodule update --init --recursive
9
- - run : cmake -DDISABLE_DOCKER_BUILDS=ON - DCMAKE_BUILD_TYPE=Debug . && make
9
+ - run : cmake -DCMAKE_BUILD_TYPE=Debug . && make
10
10
# Unfortunately need to disable leak sanitizer https://github.com/google/sanitizers/issues/916
11
11
# Still run all other ASAN components
12
12
- run : GTEST_COLOR=1 ASAN_OPTIONS=detect_leaks=0 ctest -VV
13
13
14
14
build_ledger :
15
15
docker :
16
16
- image : zondax/builder-bolos:latest
17
+ working_directory : ~/project
17
18
environment :
18
- - BOLOS_SDK= /home/zondax/project/deps/nanos-secure-sdk
19
- - BOLOS_ENV= /opt/bolos
19
+ BOLOS_SDK : /home/zondax/project/deps/nanos-secure-sdk
20
+ BOLOS_ENV : /opt/bolos
20
21
steps :
21
22
- checkout
22
23
# Docker entrypoint is not considered
23
24
- run : git submodule update --init --recursive
24
25
- run :
25
- name : Build
26
+ name : Build Standard app
26
27
command : |
27
28
source /home/zondax/.cargo/env
28
- cd /home/zondax/project
29
29
make
30
30
31
31
test_zemu :
32
32
machine :
33
- image : ubuntu-1604:201903-01
33
+ image : ubuntu-2004:202101-01
34
+ resource_class : large
34
35
working_directory : ~/repo
35
36
environment :
36
37
BASH_ENV : " /opt/circleci/.nvm/nvm.sh"
37
38
steps :
38
39
- checkout
39
40
- run : git submodule update --init --recursive
40
- - run :
41
- name : Build Ledger app
42
- command : |
43
- make
41
+ - run : sudo apt-get update -y && sudo apt-get install -y libusb-1.0.0 libudev-dev
42
+ # - run:
43
+ # name: Install rust
44
+ # command: |
45
+ # sudo apt-get update
46
+ # sudo apt-get install -y cmake binutils-dev libiberty-dev libelf-dev libdw-dev
47
+ # curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --no-modify-path --default-toolchain none -y;
48
+ # no_output_timeout: 1800s
44
49
- run :
45
50
name : Install node + yarn
46
51
command : |
47
- nvm install 13.12 .0
48
- nvm use 13.12 .0
52
+ nvm install 14.17 .0
53
+ nvm use 14.17 .0
49
54
npm install -g yarn
55
+ - run :
56
+ name : Build Ledger app
57
+ command : make
50
58
- run :
51
59
name : Build/Install build js deps
52
60
command : |
53
- nvm use 13.12.0
61
+ nvm use 14.17.0
62
+ export PATH=~/.cargo/bin:$PATH
54
63
make zemu_install
55
64
- run :
56
- name : Workaround/Pull docker
65
+ name : Check binaries are available
57
66
command : |
58
- docker pull zondax/builder-zemu
67
+ ls -l app/output
59
68
- run :
60
69
name : Run zemu tests
61
70
command : |
62
- nvm use 13.12.0
71
+ nvm use 14.17.0
72
+ export PATH=~/.cargo/bin:$PATH
63
73
make zemu_test
64
74
65
75
build_package :
66
76
docker :
67
77
- image : zondax/builder-bolos:latest
68
78
environment :
69
- - BOLOS_SDK= /home/zondax/project/deps/nanos-secure-sdk
70
- - BOLOS_ENV= /opt/bolos
79
+ BOLOS_SDK : /home/zondax/project/deps/nanos-secure-sdk
80
+ BOLOS_ENV : /opt/bolos
71
81
steps :
72
82
- checkout
73
83
- run : git submodule update --init --recursive
@@ -77,24 +87,68 @@ jobs:
77
87
source /home/zondax/.cargo/env
78
88
cd /home/zondax/project
79
89
make
80
- - store_artifacts :
81
- path : /home/zondax/project/app/pkg/zxtool.sh
82
- - run : /home/zondax/go/bin/ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete $(/home/zondax/project/app/pkg/zxtool.sh version) /home/zondax/project/app/pkg/zxtool.sh
90
+ - run : /home/zondax/go/bin/ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete $(/home/zondax/project/app/pkg/installer_s.sh version) /home/zondax/project/app/pkg/installer_s.sh
91
+
92
+ publish_npm_package :
93
+ docker :
94
+ - image : circleci/node:lts
95
+ steps :
96
+ - checkout
97
+ - run :
98
+ name : Build package
99
+ command : |
100
+ cd js
101
+ yarn install
102
+ yarn build
103
+ - run :
104
+ name : Prepare authentication config
105
+ command : echo "//registry.npmjs.org/:_authToken=$npm_TOKEN" > /home/circleci/.npmrc
106
+ - run :
107
+ name : Set package version
108
+ command : |
109
+ cd js
110
+ export NPM_VERSION=$(echo $CIRCLE_TAG | cut -c5-)
111
+ echo Publishing as "$NPM_VERSION"
112
+ npm --no-git-tag-version version "$NPM_VERSION"
113
+ - run :
114
+ name : Publish package
115
+ command : cd js && npm publish
116
+
117
+ no-tags : &no-tags
118
+ filters :
119
+ tags :
120
+ ignore : /.*/
121
+
122
+ only-npm-tags : &only-npm-tags
123
+ filters :
124
+ tags :
125
+ only : /^npm_v[0-9]+(\.[0-9]+)*/
126
+ branches :
127
+ ignore : /.*/
83
128
84
129
workflows :
85
130
version : 2
86
131
87
132
default :
88
133
jobs :
89
- - build
90
- - build_ledger
91
- - test_zemu
92
- # - build_package:
93
- # requires:
94
- # - build
95
- # - build_ledger
96
- # - test_zemu
97
- # filters:
98
- # branches:
99
- # only:
100
- # - master
134
+ - build :
135
+ << : *no-tags
136
+ - build_ledger :
137
+ << : *no-tags
138
+ - test_zemu :
139
+ << : *no-tags
140
+ - build_package :
141
+ << : *no-tags
142
+ requires :
143
+ - build
144
+ - build_ledger
145
+ - test_zemu
146
+ filters :
147
+ branches :
148
+ only :
149
+ - master
150
+
151
+ release_npm :
152
+ jobs :
153
+ - publish_npm_package :
154
+ << : *only-npm-tags
0 commit comments