This repository has been archived by the owner on Jul 11, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathwercker.yml
138 lines (117 loc) · 4.13 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
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
box: golang
build:
steps:
- setup-go-workspace
#- wercker/golint:
# exclude: "^vendor\\|enaml"
# Gets the dependencies
- script:
name: go get
code: |
cd $WERCKER_SOURCE_DIR
go version
go get github.com/Masterminds/glide
export PATH=$WERCKER_SOURCE_DIR/bin:$PATH
glide install
# Test the project
- script:
name: go test
code: |
go test $(glide novendor) -v -cover -race
- script:
name: set release id variable for version
code: |
go get github.com/xchapter7x/versioning
export WERCKER_GITHUB_CREATE_RELEASE_ID=`versioning bump_patch`
- script:
name: compile for all platforms
code: |
GOOS=darwin go build -o enaml-osx -ldflags "-X main.Version=${WERCKER_GITHUB_CREATE_RELEASE_ID}-`git rev-parse HEAD | cut -c1-6`" cmd/enaml/main.go
GOOS=linux go build -o enaml-linux -ldflags "-X main.Version=${WERCKER_GITHUB_CREATE_RELEASE_ID}-`git rev-parse HEAD | cut -c1-6`" cmd/enaml/main.go
GOOS=windows go build -o enaml-win -ldflags "-X main.Version=${WERCKER_GITHUB_CREATE_RELEASE_ID}-`git rev-parse HEAD | cut -c1-6`" cmd/enaml/main.go
- script:
name: add repo to artifact
code: |
cp -R ./ ${WERCKER_OUTPUT_DIR}
publish-release:
steps:
- script:
name: install-packages
code: |
sudo apt-get install -y openssh-client wget
ls -la
pwd
echo ${WERCKER_OUTPUT_DIR}
ls -la ${WERCKER_OUTPUT_DIR}
- wercker/[email protected]:
keyname: PCF_GITHUB_KEY
- wercker/[email protected]:
hostname: github.com
fingerprint: 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48
- script:
name: set release id variable for version
code: |
go get github.com/xchapter7x/versioning
export WERCKER_GITHUB_CREATE_RELEASE_ID=`versioning ${VERSION_COMMAND}`
- github-create-release:
token: $GITHUB_TOKEN
tag: $WERCKER_GITHUB_CREATE_RELEASE_ID
title: Enaml $WERCKER_GITHUB_CREATE_RELEASE_ID
draft: false
prerelease: ${IS_PRE_RELEASE}
- github-upload-asset:
token: $GITHUB_TOKEN
file: enaml-osx
release_id: $WERCKER_GITHUB_CREATE_RELEASE_ID
content-type: application/x-gzip
- github-upload-asset:
token: $GITHUB_TOKEN
file: enaml-win
release_id: $WERCKER_GITHUB_CREATE_RELEASE_ID
content-type: application/x-gzip
- github-upload-asset:
token: $GITHUB_TOKEN
file: enaml-linux
release_id: $WERCKER_GITHUB_CREATE_RELEASE_ID
content-type: application/x-gzip
deploy-pre-release:
steps:
- script:
name: install-packages
code: |
sudo apt-get install -y openssh-client wget
ls -la
pwd
echo ${WERCKER_OUTPUT_DIR}
ls -la ${WERCKER_OUTPUT_DIR}
- wercker/[email protected]:
keyname: PCF_GITHUB_KEY
- wercker/[email protected]:
hostname: github.com
fingerprint: 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48
- script:
name: set release id variable for version
code: |
go get github.com/xchapter7x/versioning
export WERCKER_GITHUB_CREATE_RELEASE_ID=`versioning bump_patch`-`git rev-parse HEAD | cut -c1-6`
- github-create-release:
token: $GITHUB_TOKEN
tag: $WERCKER_GITHUB_CREATE_RELEASE_ID
title: Enaml $WERCKER_GITHUB_CREATE_RELEASE_ID
draft: true
prerelease: ${IS_PRE_RELEASE}
- github-upload-asset:
token: $GITHUB_TOKEN
file: enaml-osx
release_id: $WERCKER_GITHUB_CREATE_RELEASE_ID
content-type: application/x-gzip
- github-upload-asset:
token: $GITHUB_TOKEN
file: enaml-win
release_id: $WERCKER_GITHUB_CREATE_RELEASE_ID
content-type: application/x-gzip
- github-upload-asset:
token: $GITHUB_TOKEN
file: enaml-linux
release_id: $WERCKER_GITHUB_CREATE_RELEASE_ID
content-type: application/x-gzip