-
Notifications
You must be signed in to change notification settings - Fork 722
/
Copy pathconfig.yml
272 lines (268 loc) · 7.31 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
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
version: 2.1
orbs:
node: electronjs/node@2.3.1
commands:
install:
parameters:
arch:
type: enum
enum: ['', 'arm64', 'x86_64']
default: ''
steps:
- run: git config --global core.autocrlf input
- node/install:
arch: << parameters.arch >>
node-version: '20.16'
- checkout
- node/install-packages
- run: yarn run contributors
- run: yarn run electron-releases
load-release-secrets:
steps:
- run: |
curl -X POST "$FIDDLE_SECRETS_SERVICE_ENDPOINT?format=shell" -H "Content-Type: application/json" -d '{"token":"'$CIRCLE_OIDC_TOKEN'"}' >> $BASH_ENV
test:
steps:
- run:
command: yarn test:ci
environment:
JEST_JUNIT_OUTPUT_DIR: ./reports/
- store_test_results:
path: ./reports/
jobs:
lint:
docker:
- image: cimg/base:stable
steps:
- install
- run: yarn run lint
mac-test:
parameters:
arch:
type: enum
enum: [ 'x64', 'arm64' ]
executor: node/macos
steps:
- when:
condition:
equal: ['x64', << parameters.arch >>]
steps:
- node/install-rosetta
- install:
arch: 'x86_64'
- when:
condition:
not:
equal: ['x64', << parameters.arch >>]
steps:
- install
- test
win-test:
parameters:
arch:
type: enum
enum: [ 'x64', 'arm64', 'ia32' ]
executor: node/windows
steps:
- install
- test
linux-test:
parameters:
arch:
type: enum
enum: [ 'x64', 'arm64','armv7l' ]
executor: node/linux
steps:
- install
- test
mac-build:
parameters:
arch:
type: enum
enum: [ 'x64', 'arm64' ]
executor: node/macos
steps:
- when:
condition:
equal: ['x64', << parameters.arch >>]
steps:
- node/install-rosetta
- install:
arch: 'x86_64'
- when:
condition:
not:
equal: ['x64', << parameters.arch >>]
steps:
- install
- run: chmod +x tools/add-macos-cert.sh && . ./tools/add-macos-cert.sh
- run: npx yarn run publish --arch=<< parameters.arch >> --dry-run
- store_artifacts:
path: out
- persist_to_workspace:
root: .
paths:
- out
win-build:
parameters:
arch:
type: enum
enum: [ 'x64', 'arm64', 'ia32' ]
executor: node/windows
steps:
- install
- run:
name: Write authentication cert to disk
shell: powershell.exe
command: |
New-Item $Profile.CurrentUserAllHosts -Force
$SM_CLIENT_CERT_FILE=(Join-Path -Path (Resolve-Path .\).Path -ChildPath "cert.p12")
Add-Content -Path $Profile.CurrentUserAllHosts -Value "`$env:SM_CLIENT_CERT_FILE = '$SM_CLIENT_CERT_FILE'"
[IO.File]::WriteAllBytes($SM_CLIENT_CERT_FILE, [Convert]::FromBase64String($env:SM_CLIENT_CERT_P12_BASE64))
- run:
name: "Signing Manager Setup"
shell: powershell.exe
command: |
cd C:\
curl.exe -X GET https://one.digicert.com/signingmanager/api-ui/v1/releases/smtools-windows-x64.msi/download -H "x-api-key:$env:SM_API_KEY" -o smtools-windows-x64.msi
msiexec.exe /i smtools-windows-x64.msi /quiet /qn | Wait-Process
& $env:SSM\smksp_registrar.exe list
& $env:SSM\smctl.exe windows certsync --keypair-alias=$env:KEYPAIR_ALIAS
- run:
name: npx yarn run publish
shell: powershell.exe
command: npx yarn run publish --arch=<< parameters.arch >> --dry-run
- store_artifacts:
path: out
- persist_to_workspace:
root: .
paths:
- out
linux-build:
parameters:
arch:
type: enum
enum: [ 'x64', 'arm64','armv7l' ]
executor: node/linux
resource_class: large
steps:
- run: sudo apt-get update && sudo apt install rpm squashfs-tools
- install
- run: npx yarn run publish --arch=<< parameters.arch >> --dry-run
# CircleCI doesn't let you persist files with the same name from multiple
# jobs, so only persist the .webpack path from the x64 linux-build job
- when:
condition:
not:
equal: [ << parameters.arch >>, x64 ]
steps:
- run: rm -rf .webpack/*
- store_artifacts:
path: out
- persist_to_workspace:
root: .
paths:
- out
- .webpack
publish-to-github:
docker:
- image: cimg/base:stable
steps:
- install
- attach_workspace:
at: .
- load-release-secrets
- run: yarn run publish --from-dry-run
notify-sentry-deploy:
docker:
- image: cimg/base:stable
environment:
SENTRY_ORG: electronjs
SENTRY_PROJECT: electron-fiddle
SENTRY_ENVIRONMENT: production
steps:
- install
- attach_workspace:
at: .
- run:
name: Create release and notify Sentry of deploy
command: |
curl -sL https://sentry.io/get-cli/ | bash
export SENTRY_RELEASE=Electron-Fiddle@${CIRCLE_TAG:1}
sentry-cli releases new -p $SENTRY_PROJECT $SENTRY_RELEASE
sentry-cli releases set-commits $SENTRY_RELEASE --auto
sentry-cli releases files $SENTRY_RELEASE upload-sourcemaps --url-prefix=~/.webpack ./.webpack/
sentry-cli releases finalize $SENTRY_RELEASE
sentry-cli releases deploys $SENTRY_RELEASE new -e $SENTRY_ENVIRONMENT
workflows:
build-and-test:
jobs:
- lint
- mac-test:
matrix:
parameters:
arch: [ x64, arm64 ]
- win-test:
matrix:
parameters:
arch: [ x64 ]
- linux-test:
matrix:
parameters:
arch: [ x64 ]
- mac-build:
context: fiddle-release
matrix:
parameters:
arch: [ x64, arm64 ]
filters:
tags:
only:
- /^v.*/
branches:
ignore: /.*/
- win-build:
matrix:
parameters:
arch: [ x64, ia32 ]
filters:
tags:
only:
- /^v.*/
branches:
ignore: /.*/
- linux-build:
matrix:
parameters:
arch: [ x64, arm64, armv7l ]
filters:
tags:
only:
- /^v.*/
branches:
ignore: /.*/
- publish-to-github:
context: fiddle-release
requires:
- lint
- mac-test
- win-test
- linux-test
- mac-build
- win-build
- linux-build
filters:
tags:
only:
- /^v.*/
branches:
ignore: /.*/
- notify-sentry-deploy:
requires:
- publish-to-github
filters:
tags:
only:
- /^v.*/
branches:
ignore: /.*/