-
Notifications
You must be signed in to change notification settings - Fork 20
/
BUILD.yaml
55 lines (53 loc) · 1.28 KB
/
BUILD.yaml
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
const:
foo: bar
packages:
- name: helloworld
type: generic
ephemeral: true
config:
commands:
- ["echo", "hello world"]
- name: app
type: go
srcs:
- "**/*.go"
- "**/*.html"
- "**/*.js"
- go.mod
- go.sum
deps:
- :helloworld
argdeps:
- version
prep:
- ["echo", "hello prep"]
config:
dontTest: true
buildArgs:
- -ldflags
- -X main.version=${version}
library: false
- name: goreleaser
type: generic
config:
commands:
- ["curl", "-OL", "https://github.com/goreleaser/goreleaser/releases/download/v1.10.3/goreleaser_Linux_x86_64.tar.gz"]
- ["tar", "xzf", "goreleaser_Linux_x86_64.tar.gz"]
- ["rm", "goreleaser_Linux_x86_64.tar.gz"]
scripts:
- name: release
description: releases leeway to GitHub
deps:
- :goreleaser
script: |
if [ "A$GITHUB_TOKEN" = "A" ]; then
echo "Please set the GITHUB_TOKEN env var"
exit 1
fi
if [ $(git tag | grep ${version}) ]; then
git tag --delete ${version}
git push origin --delete ${version} || echo "version wasn't pushed yet - that's ok"
fi
git tag ${version}
git push origin ${version}
goreleaser --rm-dist