-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.travis.yml
70 lines (70 loc) · 2.81 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
language: go
sudo: required
os:
- linux
addons:
apt:
packages:
- build-essential
- pkg-config
- libjpeg-dev
- libpng-dev
- libgif-dev
- libwebp-dev
- libfontconfig1-dev
- libfreetype6-dev
- libgomp1
- libexpat1-dev
go:
- master
cache:
directories:
- "$HOME/opt"
env:
global:
- IMAGEMAGICK_VERSION=7.0.8-59
before_install:
- nvm install stable
- nvm use stable
- export PATH=$HOME/opt/bin:$PATH
- convert -version | grep $IMAGEMAGICK_VERSION || { wget -q https://github.com/ImageMagick/ImageMagick/archive/${IMAGEMAGICK_VERSION}.tar.gz
&& tar xf ${IMAGEMAGICK_VERSION}.tar.gz && cd ImageMagick-${IMAGEMAGICK_VERSION}
&& ./configure --prefix=$HOME/opt && make && sudo make install && convert -version | grep
$IMAGEMAGICK_VERSION && cd $TRAVIS_BUILD_DIR; }
- export LD_FLAGS=-L$HOME/opt/lib
- export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib:$HOME/opt/lib
- export CPATH=$CPATH:$HOME/opt/include
- export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib:$HOME/opt/lib
- export PKG_CONFIG_PATH=$HOME/opt/lib/pkgconfig
install:
- go get
script:
- go build
- cd web && yarn && yarn build && cd ..
before_deploy:
- export CGO_CFLAGS_ALLOW="-fopenmp"
- export CGO_CFLAGS="`pkg-config --cflags MagickWand MagickCore`"
- export CGO_LDFLAGS="`pkg-config --libs MagickWand MagickCore` -ljpeg -lpng -lwebpmux -lwebp -lfontconfig -lfreetype -lgomp -lexpat -luuid -lz -lm -ldl"
- go env -w GO111MODULE=on
- go env -w GOPROXY=https://goproxy.cn,https://goproxy.io,direct
- go get -d && go install -tags no_pkgconfig -v gopkg.in/gographics/imagick.v3/imagick
- export TRAVIS_TAG="`git describe "--abbrev=0" "--tags"`"
- go build -tags netgo -ldflags "-linkmode 'external' -extldflags '-static' -w -s -X 'main.KimgVersion=${TRAVIS_TAG}'" -o kimg main/kimg.go
- export DIST_DIR=kimg_${TRAVIS_TAG}_${TRAVIS_OS_NAME}
- mkdir -p ${DIST_DIR}
- cp -rp kimg kimg.yaml LICENSE www ${DIST_DIR}
- tar cf ${DIST_DIR}.tar.gz ${DIST_DIR}
deploy:
provider: releases
api_key:
secure: qWK7pDHlwF1P/sr2fXKoNjov0q4IaKuAShbJLGPSQ7JR7Pv8peeyeHCPo7PYPh8nqftIpI/rq6bt/j5/0N5SHDNLJe1PEgy6Jcp+LiDDEE3BwwyMBt9ra6Lxuvn6i3778+xkNvPvSZJ5CUCptu58WZ+6mvdUYPJGSfMT11fS0UylL9c5tgh1wfZTseh6VIZ3SZWk9tHhAGORmSX1iMhFLScCcxgrpRhcHGuzGYjUPx3/vu91Xky9oUW+bdgnyM4MSO6v9S/RmlvIUeu9BktQd+Im4UuQYip4OxgB3GMWLDs1rOrdMeYPyxDIE4eLlniI/CNMDt8HMHhZeYziiUyuvi6DzKF2V9fiXyEIBQbSHP7hVT3Yu9gxbSsgtlTrm8XJYorCyP1xcbLG+33RMvD1SEuNL8ud+bATKo9+4J7SQZ9dQEfeeXXl4+e3c1TC3zcQ3Qd/6CGwJGmKQZ7HhpalwXbCaE3NfEvZfNJY/WtCX/2MaAxbxdPv/J/iHaLgBQoL+sE+0jagdvbXlUXNbAnLWqdDgNdIwl61/Kov+csNDmoIPPO6XfMW8IwJk9IW8yI4HPK9xEo+/GOnxuqU7kv0INjcfNOA/u+ZFjjL/pAYdiNG0IYme3jtZnAIf8zgO20QLErjdO0nJA6NN+SFIWM7g8/R7bYECk7CpyicimodIHg=
file: ${DIST_DIR}.tar.gz
skip_cleanup: true
overwrite: true
name: ${TRAVIS_TAG}
on:
repo: zhoukk/kimg
tags: true
notifications:
email: