forked from RoboCup-SSL/ssl-game-controller
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.yml
109 lines (105 loc) · 3.05 KB
/
config.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
version: 2
jobs:
frontend:
docker:
- image: cimg/node:16.15
steps:
- checkout
- run:
name: "Install dependencies"
command: yarn install
- run:
name: "Run lint"
command: yarn lint
- run:
name: "Build"
command: yarn build
- persist_to_workspace:
root: .
paths:
- internal/app/ui/dist/*
backend:
docker:
- image: cimg/go:1.18
steps:
- checkout
- attach_workspace:
at: .
- run: go get -v -t -d ./...
- run: go test -v -covermode=count -coverprofile=count.out ./...
- run: go tool cover -html=count.out -o coverage.html
- run:
working_directory: cmd/ssl-game-controller
command: |
GOOS=linux GOARCH=amd64 go build -o ../../release/ssl-game-controller_linux_amd64
GOOS=darwin GOARCH=amd64 go build -o ../../release/ssl-game-controller_darwin_amd64
GOOS=windows GOARCH=amd64 go build -o ../../release/ssl-game-controller_windows_amd64.exe
- persist_to_workspace:
root: .
paths:
- release/*
- store_artifacts:
path: coverage.html
destination: coverage
publish-github-release:
docker:
- image: cimg/go:1.18
steps:
- attach_workspace:
at: .
- run:
name: "Prepare artifacts"
working_directory: release
command: |
mkdir gh
cp ssl-game-controller_linux_amd64 gh/ssl-game-controller_${CIRCLE_TAG}_linux_amd64
cp ssl-game-controller_darwin_amd64 gh/ssl-game-controller_${CIRCLE_TAG}_darwin_amd64
cp ssl-game-controller_windows_amd64.exe gh/ssl-game-controller_${CIRCLE_TAG}_windows_amd64.exe
- run:
name: "Publish Release on GitHub"
command: |
go install github.com/tcnksm/[email protected]
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete ${CIRCLE_TAG} ./release/gh/
docker:
docker:
- image: cimg/base:2022.06
steps:
- checkout
- setup_remote_docker:
version: 20.10.11
- run: |
TAG=${CIRCLE_TAG:1}
TAG=${TAG:-latest}
docker build -t robocupssl/ssl-game-controller:$TAG .
docker login -u "${DOCKER_HUB_USERNAME}" -p "${DOCKER_HUB_PASSWORD}"
docker push robocupssl/ssl-game-controller:$TAG
workflows:
version: 2
main:
jobs:
- frontend:
filters:
tags:
only: /.*/
- backend:
requires:
- frontend
filters:
tags:
only: /.*/
- publish-github-release:
context: github
requires:
- backend
filters:
branches:
ignore: /.*/
tags:
only: /^v.*/
- docker:
context: docker hub
filters:
branches:
only: master
tags:
only: /^v.*/