-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
70 lines (66 loc) · 1015 Bytes
/
.gitlab-ci.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
stages:
- lint
- build
- test
- release
lint:
image: cardboard/golang:1.21.1
stage: lint
script:
- make lint.tools.install
- make lint
rules:
- changes:
- "**/*.go"
- if: "$CI_COMMIT_TAG"
cache:
key: go
paths:
- ".go-build"
interruptible: true
build:
image: cardboard/golang:1.21.1
stage: build
script:
- go build -o printd .
rules:
- changes:
- "**/*.go"
- if: "$CI_COMMIT_TAG"
artifacts:
expire_in: 3 hours
paths:
- printd
cache:
key: go
paths:
- ".go-build"
interruptible: true
test:
image: cardboard/golang:1.21.1
stage: test
script:
- make test
rules:
- changes:
- "**/*.go"
- if: "$CI_COMMIT_TAG"
needs:
- build
cache:
key: go
paths:
- ".go-build"
policy: pull
interruptible: true
release:
stage: release
image:
name: goreleaser/goreleaser:v1.14.1
entrypoint: ['']
only:
- tags
variables:
GIT_DEPTH: 0
script:
- goreleaser release --rm-dist