-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathconfig.yml
More file actions
136 lines (129 loc) · 4.4 KB
/
Copy pathconfig.yml
File metadata and controls
136 lines (129 loc) · 4.4 KB
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
version: 2.1
parameters:
cmds:
type: string
default: "ssl-remote-control"
jobs:
build_node:
resource_class: medium
docker:
- image: cimg/node:lts@sha256:86722a5bb28633b65f586f9e42e6c82c3bf35ba4d5720fa88903de0da706b7c8
steps:
- checkout
- run:
name: "Install dependencies"
working_directory: frontend
command: npm install
- run:
name: "Build"
working_directory: frontend
command: npm run build
- persist_to_workspace:
root: .
paths:
- frontend/dist/*
test_go:
resource_class: medium
docker:
- image: cimg/go:1.26.5@sha256:6b749e81f5bd5686fdafcbd972b59c0222476fd2ed09de75b7f7ea77dd8ec016
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
- store_artifacts:
path: coverage.html
destination: coverage
build_go:
resource_class: large
docker:
- image: cimg/go:1.26.5@sha256:6b749e81f5bd5686fdafcbd972b59c0222476fd2ed09de75b7f7ea77dd8ec016
steps:
- checkout
- attach_workspace:
at: .
- run: go get -v -t -d ./...
- run: |
set -u
version=${CIRCLE_TAG:-}
for cmd in << pipeline.parameters.cmds >>; do
GOOS=linux GOARCH=amd64 go build -o ./release/${cmd}_${version}_linux_amd64 ./cmd/${cmd}
GOOS=linux GOARCH=arm64 go build -o ./release/${cmd}_${version}_linux_arm64 ./cmd/${cmd}
GOOS=linux GOARCH=arm go build -o ./release/${cmd}_${version}_linux_arm ./cmd/${cmd}
GOOS=darwin GOARCH=amd64 go build -o ./release/${cmd}_${version}_darwin_amd64 ./cmd/${cmd}
GOOS=darwin GOARCH=arm64 go build -o ./release/${cmd}_${version}_darwin_arm64 ./cmd/${cmd}
GOOS=windows GOARCH=amd64 go build -o ./release/${cmd}_${version}_windows_amd64.exe ./cmd/${cmd}
done
- run: |
mkdir -p release
cp -a rpi ssl-remote-control
tar czf release/bootstrap.tar.gz ssl-remote-control
- persist_to_workspace:
root: .
paths:
- release/*
publish_gh:
resource_class: small
docker:
- image: cimg/go:1.26.5@sha256:6b749e81f5bd5686fdafcbd972b59c0222476fd2ed09de75b7f7ea77dd8ec016
steps:
- attach_workspace:
at: .
- run: |
set -u
go install github.com/tcnksm/ghr@v0.16.0
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete -generatenotes ${CIRCLE_TAG} ./release
build_docker:
resource_class: small
docker:
- image: cimg/base:2026.08@sha256:e8f07526f593ac5dee29362b7f98c6fec94c412722d6bbece731e4cc885abccb
steps:
- checkout
- setup_remote_docker
- run: |
for cmd in << pipeline.parameters.cmds >>; do
docker build --build-arg cmd=${cmd} -t robocupssl/${cmd}:latest .
done
publish_docker:
resource_class: small
docker:
- image: cimg/base:2026.08@sha256:e8f07526f593ac5dee29362b7f98c6fec94c412722d6bbece731e4cc885abccb
steps:
- checkout
- setup_remote_docker
- run: |
# Parse version from tag (removing 'v' prefix)
TAG=${CIRCLE_TAG:1}
TAG=${TAG:-latest}
for cmd in << pipeline.parameters.cmds >>; do
docker build --build-arg cmd=${cmd} -t robocupssl/${cmd}:${TAG} .
docker login -u "${DOCKER_HUB_USERNAME}" -p "${DOCKER_HUB_PASSWORD}"
docker push robocupssl/${cmd}:${TAG}
done
workflows:
version: 2
build:
jobs:
- build_node
- test_go:
requires: [ build_node ]
release:
jobs:
- build_node:
filters: { branches: { ignore: /.*/ }, tags: { only: /^v.*/ } }
- build_go:
requires: [ build_node ]
filters: { branches: { ignore: /.*/ }, tags: { only: /^v.*/ } }
- publish_gh:
context: github
requires: [ build_go ]
filters: { branches: { ignore: /.*/ }, tags: { only: /^v.*/ } }
docker:
jobs:
- build_docker:
filters: { branches: { ignore: master } }
- publish_docker:
context: docker hub
filters: { branches: { only: master }, tags: { only: /^v.*/ } }