Skip to content

Commit 932fe7e

Browse files
committed
Add ssl-ref-client and more architectures to release
1 parent 599a1d1 commit 932fe7e

File tree

1 file changed

+56
-52
lines changed

1 file changed

+56
-52
lines changed

.circleci/config.yml

Lines changed: 56 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
version: 2
1+
version: 2.1
22
jobs:
3-
frontend:
3+
build_node:
4+
resource_class: medium
45
docker:
56
- image: cimg/node:lts
67
steps:
@@ -18,7 +19,8 @@ jobs:
1819
paths:
1920
- frontend/dist/*
2021

21-
backend:
22+
test_go:
23+
resource_class: medium
2224
docker:
2325
- image: cimg/go:1.20.2
2426
steps:
@@ -28,81 +30,83 @@ jobs:
2830
- run: go get -v -t -d ./...
2931
- run: go test -v -covermode=count -coverprofile=count.out ./...
3032
- run: go tool cover -html=count.out -o coverage.html
31-
- run:
32-
working_directory: cmd/ssl-game-controller
33-
command: |
34-
GOOS=linux GOARCH=amd64 go build -o ../../release/ssl-game-controller_linux_amd64
35-
GOOS=darwin GOARCH=amd64 go build -o ../../release/ssl-game-controller_darwin_amd64
36-
GOOS=windows GOARCH=amd64 go build -o ../../release/ssl-game-controller_windows_amd64.exe
33+
- store_artifacts:
34+
path: coverage.html
35+
destination: coverage
36+
37+
build_go:
38+
resource_class: large
39+
docker:
40+
- image: cimg/go:1.20.2
41+
steps:
42+
- checkout
43+
- attach_workspace:
44+
at: .
45+
- run: go get -v -t -d ./...
46+
- run: |
47+
set -u
48+
version=${CIRCLE_TAG:-}
49+
for cmd in ssl-game-controller ssl-ref-client; do
50+
GOOS=linux GOARCH=amd64 go build -o ./release/${cmd}_${version}_linux_amd64 ./cmd/${cmd}
51+
GOOS=linux GOARCH=arm64 go build -o ./release/${cmd}_${version}_linux_arm64 ./cmd/${cmd}
52+
GOOS=linux GOARCH=arm go build -o ./release/${cmd}_${version}_linux_arm ./cmd/${cmd}
53+
GOOS=darwin GOARCH=amd64 go build -o ./release/${cmd}_${version}_darwin_amd64 ./cmd/${cmd}
54+
GOOS=darwin GOARCH=arm64 go build -o ./release/${cmd}_${version}_darwin_arm64 ./cmd/${cmd}
55+
GOOS=windows GOARCH=amd64 go build -o ./release/${cmd}_${version}_windows_amd64.exe ./cmd/${cmd}
56+
done
3757
- persist_to_workspace:
3858
root: .
3959
paths:
4060
- release/*
41-
- store_artifacts:
42-
path: coverage.html
43-
destination: coverage
4461

45-
publish-github-release:
62+
publish_gh:
63+
resource_class: small
4664
docker:
4765
- image: cimg/go:1.20.2
4866
steps:
4967
- attach_workspace:
5068
at: .
51-
- run:
52-
name: "Prepare artifacts"
53-
working_directory: release
54-
command: |
55-
mkdir gh
56-
cp ssl-game-controller_linux_amd64 gh/ssl-game-controller_${CIRCLE_TAG}_linux_amd64
57-
cp ssl-game-controller_darwin_amd64 gh/ssl-game-controller_${CIRCLE_TAG}_darwin_amd64
58-
cp ssl-game-controller_windows_amd64.exe gh/ssl-game-controller_${CIRCLE_TAG}_windows_amd64.exe
59-
- run:
60-
name: "Publish Release on GitHub"
61-
command: |
62-
go install github.com/tcnksm/[email protected]
63-
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete ${CIRCLE_TAG} ./release/gh/
69+
- run: |
70+
set -u
71+
go install github.com/tcnksm/[email protected]
72+
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete ${CIRCLE_TAG} ./release
6473
6574
docker:
75+
resource_class: small
6676
docker:
6777
- image: cimg/base:2023.04
6878
steps:
6979
- checkout
7080
- setup_remote_docker:
7181
version: 20.10.18
7282
- run: |
73-
TAG=${CIRCLE_TAG:1}
83+
TAG=${CIRCLE_TAG:-1}
7484
TAG=${TAG:-latest}
7585
docker build -t robocupssl/ssl-game-controller:$TAG .
7686
docker login -u "${DOCKER_HUB_USERNAME}" -p "${DOCKER_HUB_PASSWORD}"
7787
docker push robocupssl/ssl-game-controller:$TAG
7888
7989
workflows:
8090
version: 2
81-
main:
91+
build:
92+
jobs:
93+
- build_node
94+
- test_go:
95+
requires: [ build_node ]
96+
release:
97+
when:
98+
matches: { pattern: /^v.*/ , value: << pipeline.git.tag >> }
99+
jobs:
100+
- build_node
101+
- build_go:
102+
requires: [ build_node ]
103+
- publish_gh:
104+
requires: [ build_go ]
105+
docker:
106+
when:
107+
or:
108+
- matches: { pattern: /^v.*/ , value: << pipeline.git.tag >> }
109+
- matches: { pattern: 'master' , value: << pipeline.git.branch >> }
82110
jobs:
83-
- frontend:
84-
filters:
85-
tags:
86-
only: /.*/
87-
- backend:
88-
requires:
89-
- frontend
90-
filters:
91-
tags:
92-
only: /.*/
93-
- publish-github-release:
94-
context: github
95-
requires:
96-
- backend
97-
filters:
98-
branches:
99-
ignore: /.*/
100-
tags:
101-
only: /^v.*/
102111
- docker:
103112
context: docker hub
104-
filters:
105-
branches:
106-
only: master
107-
tags:
108-
only: /^v.*/

0 commit comments

Comments
 (0)