-
Notifications
You must be signed in to change notification settings - Fork 4
/
wercker.yml
81 lines (70 loc) · 3.55 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
box: golang
build:
steps:
# Sets the go workspace and places you package
# at the right place in the workspace tree
- setup-go-workspace
# Grab version from service-use.go
- script:
name: get version
code: export GITHUB_RELEASE_VERSION=$(awk 'BEGIN { FS="[ ,]" } /Major:/ {major=$2} /Minor:/ {minor=$2} /Build:/ {build=$2} END { print major "." minor "." build }' service-use.go)
# Gets the dependencies
- script:
name: go get
code: |
go get
# Test the project
- script:
name: go test
code: |
go test ./...
# Build the project for all the archs
- script:
name: go build
code: |
PLUGIN_NAME=service-use
GOOS=linux GOARCH=amd64 go build -o ${PLUGIN_NAME}.linux64
GOOS=linux GOARCH=386 go build -o ${PLUGIN_NAME}.linux32
GOOS=windows GOARCH=amd64 go build -o ${PLUGIN_NAME}.win64
GOOS=windows GOARCH=386 go build -o ${PLUGIN_NAME}.win32
GOOS=darwin GOARCH=amd64 go build -o ${PLUGIN_NAME}.osx
# SHA-1 sum for built artifacts
- script:
name: sha-1
code: |
PLUGIN_NAME=service-use
shasum -a 1 ${PLUGIN_NAME}.linux64 | tr "." " " | awk "{ print \" - checksum:\",\$1,\"\n platform:\",\$3,\"\n url: https://github.com/cdelashmutt-pivotal/service-use/releases/download/$GITHUB_RELEASE_VERSION/service-use-$GITHUB_RELEASE_VERSION.$3\" }"
shasum -a 1 ${PLUGIN_NAME}.linux32 | tr "." " " | awk "{ print \" - checksum:\",\$1,\"\n platform:\",\$3,\"\n url: https://github.com/cdelashmutt-pivotal/service-use/releases/download/$GITHUB_RELEASE_VERSION/service-use-$GITHUB_RELEASE_VERSION.$3\" }"
shasum -a 1 ${PLUGIN_NAME}.win64 | tr "." " " | awk "{ print \" - checksum:\",\$1,\"\n platform:\",\$3,\"\n url: https://github.com/cdelashmutt-pivotal/service-use/releases/download/$GITHUB_RELEASE_VERSION/service-use-$GITHUB_RELEASE_VERSION.$3\" }"
shasum -a 1 ${PLUGIN_NAME}.win32 | tr "." " " | awk "{ print \" - checksum:\",\$1,\"\n platform:\",\$3,\"\n url: https://github.com/cdelashmutt-pivotal/service-use/releases/download/$GITHUB_RELEASE_VERSION/service-use-$GITHUB_RELEASE_VERSION.$3\" }"
shasum -a 1 ${PLUGIN_NAME}.osx | tr "." " " | awk "{ print \" - checksum:\",\$1,\"\n platform:\",\$3,\"\n url: https://github.com/cdelashmutt-pivotal/service-use/releases/download/$GITHUB_RELEASE_VERSION/service-use-$GITHUB_RELEASE_VERSION.$3\" }"
- github-create-release:
token: $GITHUB_TOKEN
tag: $GITHUB_RELEASE_VERSION
title: $GITHUB_RELEASE_VERSION
draft: true
- github-upload-asset:
token: $GITHUB_TOKEN
file: service-use.linux64
filename: service-use-$GITHUB_RELEASE_VERSION.linux64
content-type: application/octet-stream
- github-upload-asset:
token: $GITHUB_TOKEN
file: service-use.linux32
filename: service-use-$GITHUB_RELEASE_VERSION.linux32
content-type: application/octet-stream
- github-upload-asset:
token: $GITHUB_TOKEN
file: service-use.win64
filename: service-use-$GITHUB_RELEASE_VERSION.win64
content-type: application/octet-stream
- github-upload-asset:
token: $GITHUB_TOKEN
file: service-use.win32
filename: service-use-$GITHUB_RELEASE_VERSION.win32
content-type: application/octet-stream
- github-upload-asset:
token: $GITHUB_TOKEN
file: service-use.osx
filename: service-use-$GITHUB_RELEASE_VERSION.osx
content-type: application/octet-stream