Skip to content

Commit d7d1873

Browse files
committed
- [!] fix travis-bintray CI build
1 parent 78a47a2 commit d7d1873

6 files changed

Lines changed: 83 additions & 56 deletions

File tree

.travis.yml

Lines changed: 43 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,63 @@ language: go
44

55
env:
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

1721
script:
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

2965
deploy:
3066
- provider: bintray

Makefile

Lines changed: 0 additions & 40 deletions
This file was deleted.

bintray-bin.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@
1212
},
1313

1414
"version": {
15-
"name": "latest",
15+
"name": "$VERSION",
16+
"desc": "Release $VERSION",
17+
"released": "$DATE",
1618
"gpgSign": false
1719
},
1820

1921
"files": [{
20-
"includePattern": "out/(.*)", "uploadPattern": "wireframe/$1",
22+
"includePattern": "out/(.*)", "uploadPattern": "$VERSION/$1",
2123
"matrixParams": {
2224
"override": 1
2325
}

bintray-bin.tmpl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@
1212
},
1313

1414
"version": {
15-
"name": "latest",
15+
"name": "$VERSION",
16+
"desc": "Release $VERSION",
17+
"released": "$DATE",
1618
"gpgSign": false
1719
},
1820

1921
"files": [{
20-
"includePattern": "out/(.*)", "uploadPattern": "{{.Wireframe.Proj}}/$1",
22+
"includePattern": "out/(.*)", "uploadPattern": "$VERSION/$1",
2123
"matrixParams": {
2224
"override": 1
2325
}

bintray-pkg.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
"files": [{
2323
"includePattern": "pkg/(.*)\\.deb",
24-
"uploadPattern": "pool/main/{{$.ENV.PKG1ST}}/$1_$VERSION_amd64.deb",
24+
"uploadPattern": "pool/main/{{ENV "PKG1ST"}}/$1_$VERSION_amd64.deb",
2525
"matrixParams": {
2626
"deb_distribution": "all",
2727
"deb_component": "main",

travis.tmpl

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ env:
66
global:
77
# 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.Proj}}"
910
- PKG_URL="https://github.com/{{if .Wireframe.Vendor}}{{.Wireframe.Vendor}}{{else}}{{.Wireframe.User}}{{end}}/{{.Wireframe.Proj}}"
1011
- PKG_CAT=utils
1112
- PKG_ARCH=amd64
@@ -18,7 +19,11 @@ env:
1819
- DATE_BUILD=`date -I`
1920

2021
script:
22+
2123
- date
24+
- echo $DATE_BUILD $VERSION
25+
- echo
26+
2227
- go get -t -v ./...
2328
- go build -v -ldflags="-X main.date=$DATE_BUILD"
2429
- {{.Wireframe.Proj}}
@@ -29,11 +34,33 @@ script:
2934
# linux/386 linux/amd64 linux/arm darwin/amd64 darwin/386 windows/amd64 windows/386
3035
# e.g.: out/{{.Wireframe.Proj}}-linux-amd64
3136

32-
before_deploy:
37+
# Create Debian Package
38+
- mkdir -p build
39+
- cp -v out/${PKG_NAME}-linux-amd64 build/${PKG_NAME}
3340
- gem install fpm --no-document
34-
- make pkg
35-
- sed -i -e "s/\$VERSION/$VERSION/" bintray-pkg.json
36-
- sed -i -e "s/\$DATE/$DATE_BUILD/" 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
3764

3865
deploy:
3966
- provider: bintray

0 commit comments

Comments
 (0)