forked from mh-cbon/go-bin-deb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wercker.yml
54 lines (50 loc) · 1.94 KB
/
wercker.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
box: golang:latest
build:
steps:
- script:
name: setup environment
code: |-
export GOPATH=/
mkdir -p /src/github.com/mh-cbon/
cp -a $WERCKER_SOURCE_DIR /src/github.com/mh-cbon/go-bin-deb
export WERCKER_SOURCE_DIR=/src/github.com/mh-cbon/go-bin-deb
#cd $WERCKER_SOURCE_DIR && glide install && go install
cd $WERCKER_SOURCE_DIR && go get .
apt-get update && apt-get install -y --no-install-recommends fakeroot
- script:
name: build
code: |-
export CGO_ENABLED=0
export GOLDFLAGS="-w -s -X main.VERSION=${GITHUB_RELEASE_VERSION}"
export GOARCH=amd64 && go build -ldflags "$GOLDFLAGS" -o $WERCKER_ROOT/build/$GOARCH/go-bin-deb
export GOARCH=arm64 && go build -ldflags "$GOLDFLAGS" -o $WERCKER_ROOT/build/$GOARCH/go-bin-deb
cd $WERCKER_ROOT
build/amd64/go-bin-deb generate --version $GITHUB_RELEASE_VERSION --arch amd64 && rm -rf pkg-build
build/amd64/go-bin-deb generate --version $GITHUB_RELEASE_VERSION --arch arm64 && rm -rf pkg-build
deploy:
steps:
- github-create-release:
token: $GITHUB_TOKEN
tag: $GITHUB_RELEASE_VERSION
title: $GITHUB_RELEASE_VERSION
draft: true
- github-upload-asset:
token: $GITHUB_TOKEN
content-type: binary/octet-stream
file: build/amd64/go-bin-deb
filename: amd64/go-bin-deb
- github-upload-asset:
token: $GITHUB_TOKEN
content-type: binary/octet-stream
file: build/arm64/go-bin-deb
filename: arm64/go-bin-deb
- github-upload-asset:
token: $GITHUB_TOKEN
content-type: application/vnd.debian.binary-package
file: go-bin-deb_${GITHUB_RELEASE_VERSION}_amd64.deb
filename: go-bin-deb-amd64.deb
- github-upload-asset:
token: $GITHUB_TOKEN
content-type: application/vnd.debian.binary-package
file: go-bin-deb_${GITHUB_RELEASE_VERSION}_arm64.deb
filename: go-bin-deb-arm64.deb