-
Notifications
You must be signed in to change notification settings - Fork 133
Expand file tree
/
Copy pathconfig.yml
More file actions
373 lines (343 loc) · 13.3 KB
/
Copy pathconfig.yml
File metadata and controls
373 lines (343 loc) · 13.3 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
# Root CircleCI configuration
# Configuration for individual packages lives in .circleci/src/{commands,jobs,workflows}
version: 2.1
setup: true
orbs:
continuation: circleci/continuation@0.3.1
path-filtering: circleci/path-filtering@0.1.1
slack: circleci/slack@4.12.0
parameters:
workflow:
type: string
default: 'main'
commands:
create_concatenated_patch_file:
description: 'Concatenate all patch-files. File is used as checksum source for part of caching key.'
parameters:
filename:
type: string
steps:
- run:
name: Combine patch-files to single file
command: ls -d -- packages/*/patches/*.patch | xargs cat > << parameters.filename >>
jobs:
# Generate the CircleCI continue_config.yml from .circleci/src
generate-config:
docker:
- image: cimg/base:2021.04
steps:
# The circleci cli exposed in the image doesn't support config packing
# so we install a version that does
- run:
name: Install cli
command: curl -fLSs https://raw.githubusercontent.com/CircleCI-Public/circleci-cli/master/install.sh | DESTDIR=~/cli bash
- checkout
- run:
name: Generate config
command: ~/cli config pack .circleci/src > .circleci/continue_config.yml
- persist_to_workspace:
root: ./
paths:
- .circleci/continue_config.yml
init:
working_directory: ~/apps
docker:
- image: cimg/node:20.19
resource_class: large
steps:
- checkout
- create_concatenated_patch_file:
filename: combined-patch-file.txt
- restore_cache:
keys:
- npm-cache-2025-10-01-{{ checksum "package-lock.json" }}-{{ checksum "combined-patch-file.txt" }}
- run: sudo apt-get update
- run: sudo apt-get install -y build-essential libssl-dev
- run:
name: Install dependencies
command: |
if [[ -d node_modules ]]; then
echo "Using cached node_modules, running postinstall..."
CI=true npm run postinstall
else
echo "No cache found, running fresh install..."
CI=true npm ci --prefer-offline
fi
- save_cache:
key: npm-cache-2025-10-01-{{ checksum "package-lock.json" }}-{{ checksum "combined-patch-file.txt" }}
paths:
- ./node_modules
- ./packages/protocol-dashboard/node_modules
- ./packages/web/node_modules
- ./packages/mobile/node_modules
- ./packages/embed/node_modules
- ./packages/harmony/node_modules
- ./packages/common/node_modules
- ./packages/libs/node_modules
- ./packages/sdk/node_modules
- ./packages/identity-service/node_modules
- ./packages/es-indexer/node_modules
- ./packages/ddex-entrypoint/node_modules
- ./packages/create-audius-app/node_modules
- ./packages/dotenv-linter/bin
generate-release-branch:
working_directory: ~/apps
resource_class: small
docker:
- image: cimg/base:2023.01
steps:
- checkout
- add_ssh_keys:
fingerprints:
- 'd0:0b:a0:19:ac:46:58:e4:6c:ac:34:99:f6:1b:31:bb' # github.com
- run:
name: Set git config
command: |
git config --global user.email "audius-infra@audius.co"
git config --global user.name "audius-infra"
- run:
name: Create + push branch
command: |
OLD_VERSION=$(jq -r .version packages/discovery-provider/.version.json)
NEW_VERSION=$(echo ${OLD_VERSION} | awk -F. '{$NF = $NF + 1;} 1' | sed 's/ /./g')
# Bump version for discovery node
jq --arg version "$NEW_VERSION" '.version=$version' packages/discovery-provider/.version.json > /tmp/.version.json
mv /tmp/.version.json packages/discovery-provider/.version.json
git add packages/discovery-provider/.version.json
PROTOCOL_DIRS=$(bash ./scripts/get-release-dirs.sh protocol)
CHANGELOG=$(git log --pretty=format:"[%h] %s %an" --date=short protocol-v${OLD_VERSION}..HEAD -- ${PROTOCOL_DIRS})
MESSAGE="Audius Protocol v${NEW_VERSION}
${CHANGELOG}"
git commit -m "${MESSAGE}"
git tag protocol-v${NEW_VERSION}
git push origin protocol-v${NEW_VERSION}
# Weird way to push both to main and the new release branch
git branch "release-v$NEW_VERSION"
git checkout "release-v$NEW_VERSION"
git push --set-upstream origin main "release-v$NEW_VERSION"
approve-foundation-deployment-holds:
resource_class: small
docker:
- image: cimg/base:2023.01
steps:
- checkout
- run:
name: Approve Foundation Deployment
command: bash .circleci/scripts/auto-approve-release.sh foundation
approve-sp-deployment-holds:
resource_class: small
docker:
- image: cimg/base:2023.01
steps:
- checkout
- run:
name: Approve SP Deployment
command: bash .circleci/scripts/auto-approve-release.sh sp
notify-pipeline-status:
working_directory: ~/apps
resource_class: small
docker:
- image: cimg/base:2023.01
steps:
- checkout
- run:
name: Wait For Pipeline
command: bash .circleci/scripts/wait-for-pipeline.sh
- run:
name: Generate Slack Template
command: bash .circleci/scripts/generate-slack-template.sh
- slack/notify:
channel: 'C06SP746DA7'
template: PIPELINE_STATUS_TEMPLATE
aggregate-pipeline-status:
working_directory: ~/apps
resource_class: small
docker:
- image: cimg/base:2023.01
steps:
- checkout
- run:
name: Wait For Pipeline
command: bash .circleci/scripts/wait-for-pipeline.sh
- run:
name: Generate Slack Template
command: bash .circleci/scripts/generate-slack-template.sh
- run:
name: Check status
command: bash .circleci/scripts/check-workflow-statuses.sh
- slack/notify:
template: PIPELINE_STATUS_TEMPLATE
workflows:
setup:
when:
and:
- equal: ['main', << pipeline.parameters.workflow >>]
- equal: ['disabled', 'enabled'] # Always false - CircleCI disabled
jobs:
- generate-config
- init:
context:
- Vercel
- path-filtering/filter:
name: trigger-relevant-workflows
filters:
branches:
ignore:
- main
- /^release.*$/
base-revision: main
config-path: ../workspace/.circleci/continue_config.yml
mapping: |
comms/.* run-discovery-workflow true
packages/identity-service/.* run-identity-workflow true
eth-contracts/.* run-eth-contracts-workflow true
.circleci/.* run-discovery-workflow true
.circleci/.* run-identity-workflow true
.circleci/.* run-eth-contracts-workflow true
.circleci/.* run-protocol-dashboard-workflow true
.circleci/.* run-sdk-workflow true
.circleci/.* run-web-workflow false
.circleci/.* run-mobile-workflow false
.circleci/.* run-embed-workflow true
package-lock.json run-sdk-workflow true
.* run-integration-workflow true
.* run-release-workflow false
packages/discovery-provider/.* run-discovery-workflow true
packages/web/.* run-web-workflow false
packages/web/e2e/.* run-integration-workflow true
packages/mobile/.* run-mobile-workflow false
packages/embed/.* run-embed-workflow true
packages/common/.* run-common-workflow true
packages/common/.* run-web-workflow false
packages/common/.* run-mobile-workflow false
packages/common/.* run-protocol-dashboard-workflow true
packages/protocol-dashboard/.* run-protocol-dashboard-workflow true
packages/harmony/.* run-web-workflow false
packages/harmony/.* run-protocol-dashboard-workflow true
packages/harmony/.* run-embed-workflow true
packages/eslint-config-audius/.* run-web-workflow false
packages/eslint-config-audius/.* run-mobile-workflow false
packages/sdk/.* run-sdk-workflow true
packages/sdk/.* run-create-audius-app-workflow true
packages/create-audius-app/.* run-create-audius-app-workflow true
packages/fixed-decimal/.* run-sdk-workflow true
packages/fixed-decimal/.* run-web-workflow false
packages/fixed-decimal/.* run-mobile-workflow false
packages/fixed-decimal/.* run-common-workflow true
packages/spl/.* run-sdk-workflow true
packages/spl/.* run-identity-workflow true
requires:
- generate-config
- init
workspace_path: ../workspace
- path-filtering/filter:
name: trigger-main-workflows
filters:
branches:
only: /^main$/
base-revision: main~1
config-path: ../workspace/.circleci/continue_config.yml
mapping: |
comms/.* run-discovery-workflow true
packages/identity-service/.* run-identity-workflow true
eth-contracts/.* run-eth-contracts-workflow true
.circleci/.* run-discovery-workflow true
.circleci/.* run-identity-workflow true
.circleci/.* run-eth-contracts-workflow true
.circleci/.* run-protocol-dashboard-workflow true
.circleci/.* run-sdk-workflow true
.circleci/.* run-web-workflow false
.circleci/.* run-mobile-workflow false
.circleci/.* run-embed-workflow true
package-lock.json run-sdk-workflow true
.* run-integration-workflow true
.* run-release-workflow false
packages/discovery-provider/.* run-discovery-workflow true
packages/web/.* run-web-workflow false
packages/mobile/.* run-mobile-workflow false
packages/embed/.* run-embed-workflow true
packages/common/.* run-common-workflow true
packages/common/.* run-web-workflow false
packages/common/.* run-mobile-workflow false
packages/protocol-dashboard/.* run-protocol-dashboard-workflow true
packages/harmony/.* run-web-workflow false
packages/eslint-config-audius/.* run-web-workflow false
packages/eslint-config-audius/.* run-mobile-workflow false
packages/sdk/.* run-sdk-workflow true
packages/sdk/.* run-create-audius-app-workflow true
packages/create-audius-app/.* run-create-audius-app-workflow true
packages/fixed-decimal/.* run-sdk-workflow true
packages/fixed-decimal/.* run-web-workflow false
packages/fixed-decimal/.* run-mobile-workflow false
packages/fixed-decimal/.* run-common-workflow true
packages/spl/.* run-sdk-workflow true
packages/spl/.* run-identity-workflow true
.* run-web-workflow false
.* run-mobile-workflow false
requires:
- generate-config
- init
workspace_path: ../workspace
- path-filtering/filter:
name: trigger-release-workflows
filters:
branches:
only: /^release-v.*$/
base-revision: main
config-path: ../workspace/.circleci/continue_config.yml
mapping: |
.* run-integration-workflow true
.* run-eth-contracts-workflow true
.* run-release-workflow true
.* run-sdk-workflow true
requires:
- generate-config
- init
workspace_path: ../workspace
- notify-pipeline-status:
context:
- slack-secrets
requires:
- trigger-main-workflows
filters:
branches:
only: /^main$/
- aggregate-pipeline-status:
context:
- slack-secrets
requires:
- trigger-relevant-workflows
filters:
branches:
ignore:
- main
- /^release.*$/
release-create-branch:
when:
and:
- equal: ['release-create-branch', << pipeline.parameters.workflow >>]
- equal: ['disabled', 'enabled'] # Always false - CircleCI disabled
jobs:
- generate-release-branch
auto-approve-foundation-deploy:
when:
and:
- equal: ['auto-approve-foundation-deploy', << pipeline.parameters.workflow >>]
- equal: ['disabled', 'enabled'] # Always false - CircleCI disabled
jobs:
- approve-foundation-deployment-holds:
context: [slack-secrets, circle-daily-deploy-secrets]
mobile-prod-build:
when:
and:
- equal: ['mobile-prod-build', << pipeline.parameters.workflow >>]
- equal: ['disabled', 'enabled'] # Always false - CircleCI disabled
jobs:
- generate-config
- init:
context:
- Vercel
- continuation/continue:
config_path: .circleci/continue_config.yml
parameters:
run-mobile-prod-build-workflow: true