@@ -2,25 +2,25 @@ version: 2
22jobs :
33 frontend :
44 docker :
5- - image : circleci /node:16.13.1
5+ - image : cimg /node:lts
66 steps :
77 - checkout
88 - run :
99 name : " Install dependencies"
10- command : yarn install
10+ working_directory : frontend
11+ command : npm install
1112 - run :
1213 name : " Build"
13- command : yarn build
14+ working_directory : frontend
15+ command : npm run build
1416 - persist_to_workspace :
1517 root : .
1618 paths :
17- - dist/*
19+ - frontend/ dist/*
1820
1921 backend :
2022 docker :
21- - image : circleci/golang:1.17
22-
23- working_directory : /go/src/github.com/RoboCup-SSL/ssl-vision-client
23+ - image : cimg/go:1.20
2424 steps :
2525 - checkout
2626 - attach_workspace :
3030 - run :
3131 working_directory : cmd/ssl-vision-client
3232 command : |
33- go get -v github.com/gobuffalo/packr/packr
34- GOOS=linux GOARCH=amd64 packr build -o ../../release/ssl-vision-client_linux_amd64
35- GOOS=darwin GOARCH=amd64 packr build -o ../../release/ssl-vision-client_darwin_amd64
36- GOOS=windows GOARCH=amd64 packr build -o ../../release/ssl-vision-client_windows_amd64.exe
33+ GOOS=linux GOARCH=amd64 go build -o ../../release/ssl-vision-client_linux_amd64
34+ GOOS=darwin GOARCH=amd64 go build -o ../../release/ssl-vision-client_darwin_amd64
35+ GOOS=windows GOARCH=amd64 go build -o ../../release/ssl-vision-client_windows_amd64.exe
3736 - run :
3837 working_directory : cmd/ssl-vision-cli
3938 command : |
@@ -47,25 +46,43 @@ jobs:
4746
4847 publish-github-release :
4948 docker :
50- - image : circleci/golang :1.17
49+ - image : cimg/go :1.20
5150 steps :
5251 - attach_workspace :
5352 at : .
5453 - run :
5554 name : " Prepare artifacts"
5655 working_directory : release
5756 command : |
58- mv ssl-vision-client_linux_amd64 ssl-vision-client_${CIRCLE_TAG}_linux_amd64
59- mv ssl-vision-client_darwin_amd64 ssl-vision-client_${CIRCLE_TAG}_darwin_amd64
60- mv ssl-vision-client_windows_amd64.exe ssl-vision-client_${CIRCLE_TAG}_windows_amd64.exe
61- mv ssl-vision-cli_linux_amd64 ssl-vision-cli_${CIRCLE_TAG}_linux_amd64
62- mv ssl-vision-cli_darwin_amd64 ssl-vision-cli_${CIRCLE_TAG}_darwin_amd64
63- mv ssl-vision-cli_windows_amd64.exe ssl-vision-cli_${CIRCLE_TAG}_windows_amd64.exe
57+ mkdir gh
58+ mv ssl-vision-client_linux_amd64 gh/ssl-vision-client_${CIRCLE_TAG}_linux_amd64
59+ mv ssl-vision-client_darwin_amd64 gh/ssl-vision-client_${CIRCLE_TAG}_darwin_amd64
60+ mv ssl-vision-client_windows_amd64.exe gh/ssl-vision-client_${CIRCLE_TAG}_windows_amd64.exe
61+ mv ssl-vision-cli_linux_amd64 gh/ssl-vision-cli_${CIRCLE_TAG}_linux_amd64
62+ mv ssl-vision-cli_darwin_amd64 gh/ssl-vision-cli_${CIRCLE_TAG}_darwin_amd64
63+ mv ssl-vision-cli_windows_amd64.exe gh/ssl-vision-cli_${CIRCLE_TAG}_windows_amd64.exe
6464 - run :
6565 name : " Publish Release on GitHub"
6666 command : |
67- go get github.com/tcnksm/ghr
68- ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete ${CIRCLE_TAG} ./release/
67+ go install github.com/tcnksm/[email protected] 68+ ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete ${CIRCLE_TAG} ./release/gh/
69+
70+ docker :
71+ docker :
72+ - image : cimg/base:2023.02
73+ steps :
74+ - checkout
75+ - setup_remote_docker :
76+ version : 20.10.18
77+ - run : |
78+ TAG=${CIRCLE_TAG:1}
79+ TAG=${TAG:-latest}
80+ docker build -t robocupssl/ssl-vision-client:$TAG .
81+ docker login -u "${DOCKER_HUB_USERNAME}" -p "${DOCKER_HUB_PASSWORD}"
82+ docker push robocupssl/ssl-vision-client:$TAG
83+ docker build -t robocupssl/ssl-vision-cli:$TAG .
84+ docker login -u "${DOCKER_HUB_USERNAME}" -p "${DOCKER_HUB_PASSWORD}"
85+ docker push robocupssl/ssl-vision-cli:$TAG
6986
7087workflows :
7188 version : 2
@@ -82,10 +99,18 @@ workflows:
8299 tags :
83100 only : /.*/
84101 - publish-github-release :
102+ context : github
85103 requires :
86104 - backend
87105 filters :
88106 branches :
89107 ignore : /.*/
90108 tags :
91109 only : /^v.*/
110+ - docker :
111+ context : docker hub
112+ filters :
113+ branches :
114+ only : master
115+ tags :
116+ only : /^v.*/
0 commit comments