forked from cncjs/cncjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
212 lines (200 loc) · 11.6 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
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
206
207
208
209
210
211
212
language: node_js
os:
- linux
- osx
#osx_image: xcode11.6
node_js:
- "10"
- "12"
env:
global:
- CI_BUILD_NUMBER=$TRAVIS_BUILD_NUMBER
- secure: "KPf6trtYLBDc2S/fF7H4VkNOAQ2Gc9sFj3v8aHOhNWDagACEHaPjIZdr3MGmzXji2EyQqtm6SxBxzdMbe1BNY5GRALgGI2fSyra+VwjhUeOB/UJ8oZuxhqnywbF77lbZgUYK/kOWHgCKGQxRsVZyytgK2CihOwPwzSp/CWUhBjlyjtDpUOMJXfc0USg05imR9LcwdW9o84uXGyI3XwHhqsA5szlu09Oxz+O//TMCHobb8o9b13N8Oxhdu9mgzynXCEo7TG4rwbmx2t7ymfM0TfEqfEsOOQ/A7iPJ4lxQ+FKGoKaqfITuZtUmzd4RaCK8zRVg/dYbXX2qF/RWRBKwIAfBLNLYYdFxleaBaNgGGyQw8TpNkm80u5ilmIDCrw79m0MqePZXcL4pdfRC9PBE2PO55tX/Podhk9HKovixvB4qxUj3Y45ORtSE2TO78W3Cs54JTQVN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9pB5TB9NX3mK0Lb3mEJcIgEVFBr/xLiISPUBGFmncHUpxYjZHwxXQXRcGyfOEphLM9tvmEdoILRxM67k035csAIeaLKKPJcMGmO0e/JwZacQN7s3MhD2M8NddhQvWklNjabXAJ0L9Ycujf6rI5RsGcZL2U80HKr0aYRMiVW7/MPMpLARFOUoLfuFAXKkkLHp7Lbb1W6Zftr4yxkrfDXIQsh976HkBj+czr6wGwzBwb39zX4KEm/Yc3TEIxC/kKs9bt+vVW6BG+J41neiDiuIY1D1tRA0OEq0j04zpU6n683ojfYddzFoUWCN+TB3i0HQxWsKTOGKdcQwrJs7xZ4//UzD/vOTHj18SH0nm6ImF2/7q+9wJO646gHWTGTjGFYdupuR402wb3h5vWmGfFRvX6B1QtYImmEwMFnqf2XRwTTSz3niKn2Rt1YUiCP5bEz+Dcr+e+A8Jidt6ZuJEXv5SbykTG4YBmgCuuFT5KRwv08kule7FiUtQ2KD5XE=" # CSC_KEY_PASSWORD
cache:
directories:
- $HOME/.electron
addons:
apt:
packages:
- icnsutils
- graphicsmagick
- gcc-multilib
- g++-multilib
- rpm
before_install:
- git --version
- git config --global user.name "Travis CI"
- git config --global user.email "[email protected]"
#
# https://github.com/electron-userland/electron-builder/wiki/Multi-Platform-Build#os-x
#
# Use brew to install required packages.
#
# To build app in distributable format for Windows on OS X:
# $ brew install Caskroom/cask/xquartz wine mono
#
# To build app in distributable format for Linux on OS X:
# $ brew install ruby gnu-tar libicns graphicsmagick
#
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
brew update;
fi
- npm install -g npm
- npm --version
install: npm install
before_script:
- COMMIT_LOG=`git log -1 --format='%ci %H %s'`
- echo "$COMMIT_LOG"
script:
- |
if [[ -z "$TRAVIS_TAG" ]]; then
npm run build-latest
else
npm run build
fi
after_success:
- PACKAGE_NAME=`node -e "console.log(require('./src/package.json').name)"`
- PACKAGE_VERSION=`node -e "console.log(require('./src/package.json').version)"`
- PRODUCT_NAME=CNCjs
- RELEASE=${PACKAGE_NAME}-${PACKAGE_VERSION}
- echo "$PACKAGE_NAME"
- echo "$PACKAGE_VERSION"
- echo "$PRODUCT_NAME"
- echo "$RELEASE"
- npm run coveralls
- mkdir -p releases
- |
# build:mac-x64
if [[ "$TRAVIS_NODE_VERSION" == "10" && "$TRAVIS_OS_NAME" == "osx" ]]; then
# https://github.com/electron-userland/electron-builder/issues/398
security import "scripts/certs/Certum-Code-Signing-CA-SHA2.cer" -k ~/Library/Keychains/login.keychain -T /usr/bin/codesign;
# https://github.com/electron-userland/electron-osx-sign/issues/83
# Temporarily Bypass Gatekeeper
sudo spctl --master-disable;
sudo spctl --status;
npm run build:mac-x64;
ls -al output output/*;
cp -af "output/${PRODUCT_NAME}-${PACKAGE_VERSION}.dmg" "releases/${RELEASE}-mac-x64.dmg";
ls -al releases/*;
if [[ "$TRAVIS_BRANCH" == "master" && -z "$TRAVIS_TAG" && ! -z "$(ls -A releases)" ]]; then
npm run github-release -- delete \
--owner=cncjs \
--repo=cncjs \
--tag="${TRAVIS_BRANCH}-latest" \
--name="${TRAVIS_BRANCH}" \
"*-mac-x64.dmg";
npm run github-release -- upload \
--owner=cncjs \
--repo=cncjs \
--tag="${TRAVIS_BRANCH}-latest" \
--name="${TRAVIS_BRANCH}" \
--body="${COMMIT_LOG}" \
"releases/${RELEASE}-mac-x64.dmg";
rm -f "releases/${RELEASE}-mac-x64.dmg";
fi
fi
- |
# build:linux-ia32
if [[ "$TRAVIS_NODE_VERSION" == "10" && "$TRAVIS_OS_NAME" == "linux" ]]; then
npm run build:linux-ia32;
ls -al output output/*;
cp -af "output/${PRODUCT_NAME}-${PACKAGE_VERSION}-i386.AppImage" "releases/${RELEASE}-linux-i386.AppImage";
cp -af "output/${PACKAGE_NAME}_${PACKAGE_VERSION}_i386.deb" "releases/${RELEASE}-linux-i386.deb";
cp -af "output/${PACKAGE_NAME}-${PACKAGE_VERSION}.i686.rpm" "releases/${RELEASE}-linux.i686.rpm";
pushd releases;
ln -sf ../output/linux-ia32-unpacked "${RELEASE}-linux-ia32";
tar zcfh "${RELEASE}-linux-ia32.tar.gz" "${RELEASE}-linux-ia32";
rm -f "${RELEASE}-linux-ia32";
popd;
ls -al releases/*;
if [[ "$TRAVIS_BRANCH" == "master" && -z "$TRAVIS_TAG" && ! -z "$(ls -A releases)" ]]; then
npm run github-release -- delete \
--owner=cncjs \
--repo=cncjs \
--tag="${TRAVIS_BRANCH}-latest" \
--name="${TRAVIS_BRANCH}" \
"*-linux-i386.AppImage" \
"*-linux-i386.deb" \
"*-linux.i686.rpm" \
"*-linux-ia32.tar.gz";
npm run github-release -- upload \
--owner=cncjs \
--repo=cncjs \
--tag="${TRAVIS_BRANCH}-latest" \
--name="${TRAVIS_BRANCH}" \
--body="${COMMIT_LOG}" \
"releases/${RELEASE}-linux-i386.AppImage" \
"releases/${RELEASE}-linux-i386.deb" \
"releases/${RELEASE}-linux.i686.rpm" \
"releases/${RELEASE}-linux-ia32.tar.gz";
rm -f "releases/${RELEASE}-linux-i386.AppImage";
rm -f "releases/${RELEASE}-linux-i386.deb";
rm -f "releases/${RELEASE}-linux.i686.rpm";
rm -f "releases/${RELEASE}-linux-ia32.tar.gz";
fi
fi
- |
# build:linux-x64
if [[ "$TRAVIS_NODE_VERSION" == "10" && "$TRAVIS_OS_NAME" == "linux" ]]; then
npm run build:linux-x64;
ls -al output output/*;
cp -af "output/${PRODUCT_NAME}-${PACKAGE_VERSION}.AppImage" "releases/${RELEASE}-linux-x86_64.AppImage";
cp -af "output/${PACKAGE_NAME}_${PACKAGE_VERSION}_amd64.deb" "releases/${RELEASE}-linux-amd64.deb";
cp -af "output/${PACKAGE_NAME}-${PACKAGE_VERSION}.x86_64.rpm" "releases/${RELEASE}-linux.x86_64.rpm";
pushd releases;
ln -sf ../output/linux-unpacked "${RELEASE}-linux-x64";
tar zcfh "${RELEASE}-linux-x64.tar.gz" "${RELEASE}-linux-x64";
rm -f "${RELEASE}-linux-x64";
popd;
ls -al releases/*;
if [[ "$TRAVIS_BRANCH" == "master" && -z "$TRAVIS_TAG" && ! -z "$(ls -A releases)" ]]; then
npm run github-release -- delete \
--owner=cncjs \
--repo=cncjs \
--tag="${TRAVIS_BRANCH}-latest" \
--name="${TRAVIS_BRANCH}" \
"*-linux-x86_64.AppImage" \
"*-linux-amd64.deb" \
"*-linux.x86_64.rpm" \
"*-linux-x64.tar.gz";
npm run github-release -- upload \
--owner=cncjs \
--repo=cncjs \
--tag="${TRAVIS_BRANCH}-latest" \
--name="${TRAVIS_BRANCH}" \
--body="${COMMIT_LOG}" \
"releases/${RELEASE}-linux-x86_64.AppImage" \
"releases/${RELEASE}-linux-amd64.deb" \
"releases/${RELEASE}-linux.x86_64.rpm" \
"releases/${RELEASE}-linux-x64.tar.gz";
rm -f "releases/${RELEASE}-linux-x86_64.AppImage";
rm -f "releases/${RELEASE}-linux-amd64.deb";
rm -f "releases/${RELEASE}-linux.x86_64.rpm";
rm -f "releases/${RELEASE}-linux-x64.tar.gz";
fi
fi
- |
# docker image
if [[ "$TRAVIS_NODE_VERSION" == "10" && "$TRAVIS_OS_NAME" == "linux" ]]; then
travis_wait 40 scripts/travis-docker-build.sh;
fi
before_deploy:
- echo "Deploying to GitHub releases"
deploy:
provider: releases
api_key:
secure: "nIhLqo+6i/uI0FgneK5nPvzYMEGO0ch7K1kbae/W/DqInqoT+moEAa16vHko3NR4SouICAEuT2GwiP/NdL7V3LZNOBOHmGa9iysBlxH8JU2AgDJiv2daXMTgGmVV7hl2sII5a8utVRFecVjZNJ+EecbU067y9S3gHbsrFlWwdUbLIpVM5+jr0YuXpV949OW8770MKLqvSONL4QoDJD7exNJ77TcHIFZURsr0VSK7rEhCDJhcUzrcn/mXLtVbAJwpBJXPMSj0lObMt1NvaQ6/iQL/rNCv5LYBOhRc0tZaBNRq8xJGR71mA35Vcrt50EP/fFakqdg3n59yO4K26C7GCHEiddlhjFKO1j9ul/98PZ4okw2FBFy1pChNuzme02tguLN85wzKSFERaCbBiNvWvR5MMEWlSuewFKojkbEqSDpZTRvyc6ct/KkvXBr1JXemfH3Uc3ANwNKcuB7566NtN29ogzOJHF/P3OEUy7ny19CZp55kVOKEeCCO3LtubaBwn+S9fP0aKCUC0Q8uHWy1Pfi8iG4XZs+jhPmwj+8OFP4DTBZMR9evk7Iq8/rMYL0WfsDuvbFygyEPWpduJ2YIl31z+7kN0OxQdCwHbNZcxP0n3ieIuNa0K74qfpL6mn0ZaLB1wA7fW/dTc9tF9lMsS577hKGcDwoZPm9VfQ+sVic="
file_glob: true
file:
- "releases/*.*"
overwrite: true
skip_cleanup: true
on:
# https://docs.travis-ci.com/user/deployment#Conditional-Releases-with-on
tags: true # Deploy app only when a tag is applied to the commit
node: "10"