19
19
- GOCACHE : /tmp/go/cache
20
20
steps :
21
21
- checkout
22
-
23
- - restore_cache :
24
- name : Restoring Cache for vendor
25
- key : gopkg-{{ arch }}-{{ .Branch }}-{{ checksum "Gopkg.lock" }}
26
- paths :
27
- - /go/src/github.com/splunk/vault-plugin-splunk/vendor
28
- - restore_cache :
29
- name : Restoring Cache for build
30
- keys :
31
- - build-cache-{{ arch }}-{{ .Branch }}-{{ .Environment.CIRCLE_PREVIOUS_BUILD_NUM }}
32
- paths :
33
- - /tmp/go/cache
34
-
35
- - run :
36
- name : Build
37
- command : make build DEPFLAGS=-v
38
22
- run :
39
23
name : Wait for Splunk Container
40
24
command : curl -4sSk --retry 40 --retry-connrefused --retry-delay 3 -o /dev/null ${SPLUNK_ADDR}
@@ -49,43 +33,14 @@ jobs:
49
33
command : |
50
34
export GOVERSION=$(go version | awk '{sub("^go","",$3);print $3;}')
51
35
[ -n "$CIRCLE_TAG" ] || tagargs="--snapshot"
52
- scripts/goreleaser --rm-dist --skip-publish $tagargs
53
- rm -rf $(find ./dist/* -type d) dist/config.yaml || true
36
+ scripts/goreleaser --rm-dist $tagargs
54
37
- store_test_results :
55
38
path : test-results/
56
39
- store_artifacts :
57
40
path : test-results/
58
41
- store_artifacts :
59
42
path : dist/
60
43
61
- - save_cache :
62
- name : Saving Cache for vendor
63
- key : gopkg-{{ arch }}-{{ .Branch }}-{{ checksum "Gopkg.lock" }}
64
- paths :
65
- - /go/src/github.com/splunk/vault-plugin-splunk/vendor
66
- - save_cache :
67
- name : Saving Cache for build
68
- key : build-cache-{{ arch }}-{{ .Branch }}-{{ .Environment.CIRCLE_BUILD_NUM }}
69
- paths :
70
- - /tmp/go/cache
71
-
72
- - persist_to_workspace :
73
- root : dist/
74
- paths : .
75
-
76
- publish-github-release :
77
- docker :
78
- - image : circleci/golang:1.12
79
- steps :
80
- - attach_workspace :
81
- at : ./artifacts
82
- - run :
83
- name : " Publish Release on GitHub"
84
- command : |
85
- go get github.com/tcnksm/ghr
86
- TAG=v$(echo artifacts/vault-plugin-splunk_*_*.zip | awk -F_ '{print $2;exit;}')
87
- ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -recreate ${TAG} ./artifacts/
88
-
89
44
workflows :
90
45
version : 2
91
46
workflow :
@@ -94,11 +49,3 @@ workflows:
94
49
filters :
95
50
tags :
96
51
only : /^v\d+\.\d+\.\d+$/
97
- - publish-github-release :
98
- requires :
99
- - build
100
- filters :
101
- branches :
102
- ignore : /.*/
103
- tags :
104
- only : /^v\d+\.\d+\.\d+$/
0 commit comments