forked from miketout/Agama
-
Notifications
You must be signed in to change notification settings - Fork 19
/
.gitlab-ci.yml
205 lines (203 loc) · 9.67 KB
/
.gitlab-ci.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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
stages:
- build
- test
- deploy
########################################################################################################################
####START#### PROJECT LEVEL VARIABLES ####START####
########################################################################################################################
variables:
DOCKER_DRIVER: overlay2
DEFAULT_VERUSCOIN_BRANCH: master
AGAMA_VERSION: 0.6.2
VERUSCOIN_VERSION: 0.6.2
KOMODO_VERSION: 0.5.0
BINARY_SOURCE: VerusCoin
EASYDEX_GUI_BUILD: build.tar.gz
AGAMA_APPIMAGE: Agama-Linux-v${AGAMA_VERSION}.AppImage
AGAMA_LINUX_TAR: Agama-Linux-v${AGAMA_VERSION}.tar.gz
AGAMA_WINDOWS_ZIP: Agama-Windows-v${AGAMA_VERSION}.zip
AGAMA_MACOS: Agama-MacOS-v${AGAMA_VERSION}.dmg
GIT_SUBMODULE_STRATEGY: recursive
POST_COMMENT: "Pipeline Trigger: ${CI_PIPELINE_SOURCE}\n
Branch: ${CI_COMMIT_REF_NAME}\n
Commit: https://github.com/VerusCoin/Agama/commit/${CI_COMMIT_SHA}\n
${CI_COMMIT_MESSAGE}\n"
########################################################################################################################
####END#### PROJECT LEVEL VARIABLES ####END####
########################################################################################################################
########################################################################################################################
########################################################################################################################
####START#### Build Stage: compile and package komodo binaries for Verus CLI ####START#####
########################################################################################################################
########################################################################################################################
####START#### LINUX ####START####
########################################################################################################################
build:linux:
image: asherd/agama-builder
stage: build
before_script:
- echo "$AUTH_KEY" > AUTH_KEY.json &&
gcloud auth activate-service-account
--key-file AUTH_KEY.json &&
rm AUTH_KEY.json
- if [ -z "${UPSTREAM_CLI_BRANCH}" ]; then export
VERUS_CLI_LINUX="${BINARY_SOURCE}/${DEFAULT_VERUSCOIN_BRANCH}/Linux/Verus-CLI-Linux-v${VERUSCOIN_VERSION}-amd64.tar.gz"
POST_COMMENT="${POST_COMMENT}Using ${BINARY_SOURCE}/${DEFAULT_VERUSCOIN_BRANCH} binaries.";
else
export POST_COMMENT="${POST_COMMENT}Using ${UPSTREAM_TRIGGER}/${UPSTREAM_CLI_BRANCH} binaries."; fi
- cd gui/EasyDEX-GUI/react
- yarn install
- yarn run build
- cd ../../..
- mkdir -p assets/bin/linux64/verusd
- gsutil cp $STAGING/$VERUS_CLI_LINUX .
- tar -xzvf Verus-CLI-Linux-v${VERUSCOIN_VERSION}-amd64.tar.gz --strip=1 --directory assets/bin/linux64/verusd
- rm Verus-CLI-Linux-v${VERUSCOIN_VERSION}-amd64.tar.gz
- wget https://github.com/KomodoPlatform/komodo/releases/download/0.5.0/komodo_0.5.0_linux.tar.gz
- tar -xzvf komodo_${KOMODO_VERSION}_linux.tar.gz --strip=1 --directory assets/bin/linux64
- rm komodo_${KOMODO_VERSION}_linux.tar.gz
- strip --strip-unneeded assets/bin/linux64/komodod && strip --strip-unneeded assets/bin/linux64/komodo-cli
- yarn install
script:
- yarn run dist
- cd dist
- chmod 755 ${AGAMA_APPIMAGE}
- tar -czvf ${AGAMA_LINUX_TAR} ${AGAMA_APPIMAGE}
- sha256sum ${AGAMA_LINUX_TAR} > ${AGAMA_LINUX_TAR}.sha256
- mv ${AGAMA_LINUX_TAR} ${AGAMA_LINUX_TAR}.sha256 ..
after_script:
- curl -F file=@"$AGAMA_LINUX_TAR"
-F channels="$AGAMA_POST_CHANNEL"
-F initial_comment="${POST_COMMENT}"
-H "${SLACK_BOT_AUTH}"
"https://slack.com/api/files.upload"
artifacts:
paths:
- ${AGAMA_LINUX_TAR}
- ${AGAMA_LINUX_TAR}.sha256
- ${AGAMA_APPIMAGE}
- ${AGAMA_APPIMAGE}.sha256 ..
- dist
expire_in: 1 week
########################################################################################################################
####END#### LINUX ####END####
########################################################################################################################
####START#### WINDOWS ####START####
########################################################################################################################
build:windows:
stage: build
image: asherd/agama-builder:windows
before_script:
- echo "$AUTH_KEY" > AUTH_KEY.json &&
gcloud auth activate-service-account
--key-file AUTH_KEY.json &&
rm AUTH_KEY.json
- if [ -z "${UPSTREAM_CLI_BRANCH}" ]; then export
VERUS_CLI_WINDOWS="${BINARY_SOURCE}/${DEFAULT_VERUSCOIN_BRANCH}/Windows/Verus-CLI-Windows-v${VERUSCOIN_VERSION}.zip"
POST_COMMENT="${POST_COMMENT}Using ${BINARY_SOURCE}/${DEFAULT_VERUSCOIN_BRANCH} binaries.";
else
export POST_COMMENT="${POST_COMMENT}Using ${UPSTREAM_TRIGGER}/${UPSTREAM_CLI_BRANCH} binaries."; fi
- cd gui/EasyDEX-GUI/react
- yarn install
- yarn run build
- cd ../../..
- mkdir -p assets/bin/
- gsutil cp $STAGING/$VERUS_CLI_WINDOWS .
- unzip -qq Verus-CLI-Windows-v${VERUSCOIN_VERSION}.zip -d assets/bin/win64
- mv assets/bin/win64/verus-cli assets/bin/win64/verusd
- wget https://github.com/KomodoPlatform/komodo/releases/download/0.5.0/komodo_0.5.0_windows.zip
- unzip komodo_${KOMODO_VERSION}_windows.zip -d assets/bin
- rm komodo_${KOMODO_VERSION}_windows.zip
- strip --strip-unneeded assets/bin/win64/komodod.exe && strip --strip-unneeded assets/bin/win64/komodo-cli.exe && strip --strip-unneeded assets/bin/win64/komodo-tx.exe
- rm Verus-CLI-Windows-v${VERUSCOIN_VERSION}.zip
- yarn install
script:
- yarn run dist-win
- cd dist
- unzip ${AGAMA_WINDOWS_ZIP} -d Agama-Windows-v${AGAMA_VERSION}
- rm ${AGAMA_WINDOWS_ZIP}
- zip -r ${AGAMA_WINDOWS_ZIP} Agama-Windows-v${AGAMA_VERSION}
- sha256sum ${AGAMA_WINDOWS_ZIP} > ${AGAMA_WINDOWS_ZIP}.sha256
- mv ${AGAMA_WINDOWS_ZIP} ${AGAMA_WINDOWS_ZIP}.sha256 ..
after_script:
- curl -F file=@"$AGAMA_WINDOWS_ZIP"
-F channels="$AGAMA_POST_CHANNEL"
-F initial_comment="${POST_COMMENT}"
-H "${SLACK_BOT_AUTH}"
"https://slack.com/api/files.upload"
artifacts:
paths:
- ${AGAMA_WINDOWS_ZIP}
- ${AGAMA_WINDOWS_ZIP}.sha256
- dist
expire_in: 1 week
########################################################################################################################
####END#### WINDOWS ####END####
########################################################################################################################
####START#### MACOS ####START####
########################################################################################################################
build:mac:
stage: build
tags: ["Mojave"]
before_script:
- if [ -z "${UPSTREAM_CLI_BRANCH}" ]; then export
VERUS_CLI_MACOS="${BINARY_SOURCE}/${DEFAULT_VERUSCOIN_BRANCH}/MacOS/Verus-CLI-MacOS-v${VERUSCOIN_VERSION}.tar.gz";
POST_COMMENT="${POST_COMMENT}Using ${BINARY_SOURCE}/${DEFAULT_VERUSCOIN_BRANCH} binaries.";
else
export POST_COMMENT="${POST_COMMENT}Using ${UPSTREAM_TRIGGER}/${UPSTREAM_CLI_BRANCH} binaries."; fi
- cd gui/EasyDEX-GUI/react
- yarn install
- yarn run build
- cd ../../..
- gsutil cp $STAGING/$VERUS_CLI_MACOS .
- wget https://github.com/KomodoPlatform/komodo/releases/download/0.5.0/komodo_0.5.0_macOS.gz
- mkdir -p assets/bin/osx/verusd
- tar -xzf Verus-CLI-MacOS-v${VERUSCOIN_VERSION}.tar.gz --strip=1 --directory assets/bin/osx/verusd
- tar -xzvf komodo_${KOMODO_VERSION}_macOS.gz --strip=1 --directory assets/bin/osx
- rm komodo_${KOMODO_VERSION}_macOS.gz
- rm Verus-CLI-MacOS-v${VERUSCOIN_VERSION}.tar.gz
- yarn install
script:
- export USE_HARD_LINKS=false
- yarn run dist
- cd dist
- shasum -a 256 ${AGAMA_MACOS} > ${AGAMA_MACOS}.sha256
- mv ${AGAMA_MACOS} ${AGAMA_MACOS}.sha256 ..
after_script:
- curl -F file=@"${AGAMA_MACOS}"
-F channels="${AGAMA_POST_CHANNEL}"
-F initial_comment="${POST_COMMENT}"
-H "${SLACK_BOT_AUTH}"
"https://slack.com/api/files.upload"
artifacts:
paths:
- ${AGAMA_MACOS}
- ${AGAMA_MACOS}.sha256
- dist
expire_in: 1 week
deploy:
stage: deploy
image: google/cloud-sdk:alpine
dependencies:
- build:linux
- build:windows
- build:mac
script:
- mkdir -p $CI_COMMIT_REF_NAME/Windows
- mkdir -p $CI_COMMIT_REF_NAME/Linux
- mkdir -p $CI_COMMIT_REF_NAME/MacOS
- cp ${AGAMA_LINUX_TAR} ${CI_COMMIT_REF_NAME}/Linux
- cp ${AGAMA_WINDOWS_ZIP} ${CI_COMMIT_REF_NAME}/Windows
- cp ${AGAMA_MACOS} ${CI_COMMIT_REF_NAME}/MacOS
- echo ${AUTH_KEY} > AUTH_KEY.json
- gcloud auth activate-service-account --key-file AUTH_KEY.json
- gsutil rsync -r $CI_COMMIT_REF_NAME $STAGING/Agama/$CI_COMMIT_REF_NAME/
artifacts:
paths:
- ${AGAMA_LINUX_TAR}
- ${AGAMA_LINUX_TAR}.sha256
- ${AGAMA_WINDOWS_ZIP}
- ${AGAMA_WINDOWS_ZIP}.sha256
- ${AGAMA_MACOS}
- ${AGAMA_MACOS}.sha256
expire_in: 1 week