Skip to content
This repository was archived by the owner on Dec 11, 2023. It is now read-only.

Commit a994919

Browse files
committed
CI setup, #9
Signed-off-by: tzununbekov <[email protected]>
1 parent 6b2ac47 commit a994919

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

.circleci/config.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
version: 2
2+
jobs:
3+
build:
4+
working_directory: /go/src/github.com/triggermesh/aws-custom-runtime
5+
docker:
6+
- image: circleci/golang
7+
steps:
8+
- checkout
9+
- restore_cache:
10+
keys:
11+
- v1-pkg-cache
12+
- run:
13+
name: Build binaries
14+
command: |
15+
CGO_ENABLED=0 go build
16+
- persist_to_workspace:
17+
root: /go/src/github.com/triggermesh/aws-custom-runtime
18+
paths:
19+
- aws-custom-runtime
20+
- save_cache:
21+
key: v1-pkg-cache
22+
paths:
23+
- "/go/pkg"
24+
25+
release:
26+
docker:
27+
- image: circleci/golang
28+
steps:
29+
- checkout
30+
- attach_workspace:
31+
at: /tmp/artifacts
32+
- run:
33+
name: "Publish Release on GitHub"
34+
command: |
35+
go get github.com/tcnksm/ghr
36+
# Temporary hardcoded single version
37+
VERSION=0.0.1
38+
# VERSION=$(git describe --tags `git rev-list --tags --max-count=1`)
39+
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete ${VERSION} /tmp/artifacts
40+
workflows:
41+
version: 2
42+
main:
43+
jobs:
44+
- build:
45+
filters:
46+
tags:
47+
only: /^v\d+\.\d+\.\d+$/
48+
- release:
49+
requires:
50+
- build
51+
filters:
52+
# Publish master as release for now
53+
branches:
54+
# ignore: /.*/
55+
only:
56+
- master
57+
tags:
58+
only: /^v\d+\.\d+\.\d+$/

0 commit comments

Comments
 (0)