forked from Snapmaker/Luban
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
94 lines (84 loc) · 3.51 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
os:
- linux
# Linux Ubuntu Precise
sudo: required
dist: trusty
group: travis_latest
language: node_js
node_js:
- '10'
cache:
directories:
- $HOME/.electron
addons:
apt:
packages:
- icnsutils
- graphicsmagick
- gcc-multilib
- g++-multilib
- libgconf-2-4
- binutils
- rpm
before_install:
- git --version
- git config --global user.name "Travis CI"
- git config --global user.email "[email protected]"
- npm install -g npm@latest
- npm --version
install:
- travis_wait 40 npm install
script:
- npm run build
after_success:
- npm run coveralls
- mkdir -p releases
- PRODUCT_NAME='Snapmaker Luban'
- PACKAGE_NAME=`node -e "console.log(require('./src/package.json').name)"`
- PACKAGE_VERSION=`node -e "console.log(require('./src/package.json').version)"`
- RELEASE=${PACKAGE_NAME}-${PACKAGE_VERSION}
- |
# Build Linux versions (deb, rpm)
if [ "$TRAVIS_OS_NAME" == "linux" ] && [ -n "$TRAVIS_TAG" ]; then
npm run build:linux-x64;
ls -al output output/*;
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/*;
fi
- |
# build:linux-ia32
# Build Linux versions (deb, rpm)
# Note that .deb and .rpm packages are failed to build, because of lack of support of serialport 32-bit
if [ "$TRAVIS_OS_NAME" == "linux" ] && [ -n "$TRAVIS_TAG" ]; then
npm run build:linux-ia32;
ls -al output output/*;
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/*;
fi
before_deploy:
- echo "Deploying to GitHub releases"
deploy:
provider: releases
api_key:
secure: "QtewfRD/MvdNFkslx4GWC9cWUGcENWW29sOnfeggK+x41QZs7Z42142/Ca0k48B9vqKRaw3ORwuRb0CtItqH/LIZo4UhQ/m7qfkNRyVrU95a1fMImJ4G+FYmBdXj095SxFFIxaNAUeyeDB/xr1aCkXu4niG6ESes9nx4s2SBSj/XQs2zD1dVNMWwFWooXVflumyKSPpLd6KoD939rwAHPmv6qZHOawrI75zHuMuzxHR8PZw8XS4BSasq/J6pkLFmCedOrIvhGIO49j80YwaeaJQGCNionpNQNV0Tk7FQ73irz6apxr1n3WecenZZxYY6i0ohoSWNtRQ13GUrv4KJ74o+4kWWHq00tBEjpusYhBOOz/rn1MqtRi7+F5MnGwnMZC8BqjTE4fZujtknCeaJL+P+4c+Mj3qTTaE58Xc3SMIxJTo4sxQJnMvil5tGDZ+z7ToS3O+P8hjwdATlQDWQJq/FjRIMYHG8ZSJKzEl8If8qOXNptm2RS9T+nkI11z1ODww4t30VkHZwVsEUjPabklhFxVOar8bRx8zTeCxBz80tR1OjX2mbUzCX+i4oOpiGv0u3SSXivxlq3okPW9CmLjnQc0k3XV7uo3rceg5y1AXms5/SdCQowbG1mj/0pgCBvQX1fmvMY5ugxGgEOalDOOKS5BzP2C1Dj4bNA8pbEW4="
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'