@@ -4,27 +4,63 @@ language: go
44
55env :
66 global :
7- # http://pkg-go.alioth.debian.org/packaging.html
7+ # Package setup (Ref: http://pkg-go.alioth.debian.org/packaging.html)
88 - VERSION="${TRAVIS_TAG:=0.0~git$(date +%Y%m%d)-1}"
9+ - PKG_NAME="wireframe"
910 - PKG_URL="https://github.com/go-easygen/wireframe"
1011 - PKG_CAT=utils
1112 - PKG_ARCH=amd64
1213 - PKG_DESC="wire-frame construction to get the project quickly into shape"
1314 - PKG_VEND="go-easygen"
14- - PKG_MAINT=" Tong Sun <suntong@cpan.org>"
15+ - PKG_MAINT=' Tong Sun <suntong@cpan.org>'
1516 - PKG_LICNS="MIT"
17+ # Build time setup
18+ - TZ=America/Toronto
19+ - DATE_BUILD=`date -I`
1620
1721script :
22+
23+ - date
24+ - echo $DATE_BUILD $VERSION
25+ - echo
26+
1827 - go get -t -v ./...
28+ - go build -v -ldflags="-X main.date=$DATE_BUILD"
29+ - wireframe
30+ - go test -v ./...
31+
1932 - go get github.com/mitchellh/gox
20- - gox -osarch="linux/386 linux/amd64 darwin/amd64 windows/amd64" -output="out/{{.Dir}}-{{.OS}}-{{.Arch}}"
33+ - gox -ldflags="-X main.date=$DATE_BUILD" - osarch="linux/386 linux/amd64 darwin/amd64 windows/amd64" -output="out/{{.Dir}}-{{.OS}}-{{.Arch}}"
2134# linux/386 linux/amd64 linux/arm darwin/amd64 darwin/386 windows/amd64 windows/386
35+ # e.g.: out/wireframe-linux-amd64
2236
23- before_deploy :
37+ # Create Debian Package
38+ - mkdir -p build
39+ - cp -v out/${PKG_NAME}-linux-amd64 build/${PKG_NAME}
2440 - gem install fpm --no-document
25- - make pkg
26- - sed -i -e "s/\$VERSION/$VERSION/" bintray-pkg.json
27- - sed -i -e "s/\$DATE/$(date +%Y-%m-%d)/" bintray-pkg.json
41+ - mkdir -p pkg
42+ - >-
43+ fpm --verbose -s dir -t deb
44+ --name ${PKG_NAME}
45+ --package pkg/${PKG_NAME}.deb
46+ --force
47+ --deb-compression bzip2
48+ --url "${PKG_URL}"
49+ --category ${PKG_CAT}
50+ --description "${PKG_DESC}"
51+ --maintainer "${PKG_MAINT}"
52+ --vendor "${PKG_VEND}"
53+ --license "${PKG_LICNS}"
54+ --version ${VERSION}
55+ --architecture ${PKG_ARCH}
56+ --depends apt
57+ --deb-compression gz
58+ ./build/=/usr/bin/
59+ # --deb-compression gz: https://unix.stackexchange.com/questions/441032/
60+ - ar t pkg/${PKG_NAME}.deb
61+
62+ - sed -i -e "s/\$VERSION/$VERSION/" bintray-bin.json bintray-pkg.json
63+ - sed -i -e "s/\$DATE/$DATE_BUILD/" bintray-bin.json bintray-pkg.json
2864
2965deploy :
3066 - provider : bintray
0 commit comments