-
Notifications
You must be signed in to change notification settings - Fork 0
598 lines (519 loc) · 25.9 KB
/
create-release.yaml
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
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
name: Create release
on:
push:
branches: [ main ]
jobs:
create_release_pubsub_onchain:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-22.04 ]
python-version: [ 3.11 ]
node-version: [ 18.16.0 ]
ganache-version: [ 7.9.1 ]
solc-version: [ v0.8.21 ]
env:
SOLC_BIN: ${{ github.workspace }}/pubsub-onchain/build/solc-static-linux
PROJECT_DIR: ${{ github.workspace }}/pubsub-onchain
SOLC_FLAGS: >-
--optimize --optimize-runs 200
--revert-strings strip
--via-ir
--overwrite
--base-path ${{ github.workspace }}/pubsub-onchain
--output-dir ${{ github.workspace }}/pubsub-onchain/build/
SOLC_VER_CMD: >-
${{ github.workspace }}/pubsub-onchain/build/solc-static-linux
--version | tail -n 1 | sed -e "s/^Version: //g"
RELE_NOTE: ${{ github.workspace }}/pubsub-onchain/build/release_note.md
name: create-release-pubsub-onchain
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Installing Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Installing Python packages
run: |
python3 -m pip install --requirement ${PROJECT_DIR}/utils/gas_cost_eval_requirements.txt
- name: Installing Node ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Installing NPM packages
run: |
npm install -g ganache@${{ matrix.ganache-version }}
- name: Installing Solc compiler
run: |
mkdir -p $(dirname ${SOLC_BIN})
curl -fsSL -o ${SOLC_BIN} \
https://github.com/ethereum/solidity/releases/download/${{ matrix.solc-version }}/solc-static-linux
chmod +x ${SOLC_BIN}
- name: Compiling contracts for PubSub/EventManager.sol
run: |
${SOLC_BIN} ${SOLC_FLAGS} --bin ${PROJECT_DIR}/PubSub/EventManager.sol
${SOLC_BIN} ${SOLC_FLAGS} --abi ${PROJECT_DIR}/PubSub/EventManager.sol
- name: Compiling contracts for PubSub/PubSubService.sol
run: |
${SOLC_BIN} ${SOLC_FLAGS} --bin ${PROJECT_DIR}/PubSub/PubSubService.sol
${SOLC_BIN} ${SOLC_FLAGS} --abi ${PROJECT_DIR}/PubSub/PubSubService.sol
- name: Compiling contracts for tests/HelloWorldSubscriber.sol
run: |
${SOLC_BIN} ${SOLC_FLAGS} --bin ${PROJECT_DIR}/tests/HelloWorldSubscriber.sol
${SOLC_BIN} ${SOLC_FLAGS} --abi ${PROJECT_DIR}/tests/HelloWorldSubscriber.sol
- name: Compiling contracts for tests/HelloWorldPublisher.sol
run: |
${SOLC_BIN} ${SOLC_FLAGS} --bin ${PROJECT_DIR}/tests/HelloWorldPublisher.sol
${SOLC_BIN} ${SOLC_FLAGS} --abi ${PROJECT_DIR}/tests/HelloWorldPublisher.sol
- name: Calculating checksums of the binary
working-directory: ${{ env.PROJECT_DIR }}/build/
run: |
sha256sum solc-static-linux >> checksums.txt
sha256sum EventManager.bin >> checksums.txt
sha256sum EventManager.abi >> checksums.txt
sha256sum PubSubService.bin >> checksums.txt
sha256sum PubSubService.abi >> checksums.txt
sha256sum HelloWorldPublisher.bin >> checksums.txt
sha256sum HelloWorldPublisher.abi >> checksums.txt
sha256sum HelloWorldSubscriber.bin >> checksums.txt
sha256sum HelloWorldSubscriber.abi >> checksums.txt
- name: Prepare binaries for gas cost evaluation
working-directory: ${{ env.PROJECT_DIR }}/build/
run: |
mkdir -p PubSub
cp EventManager.bin PubSub/EventManager.bin
cp EventManager.abi PubSub/EventManager.abi
cp PubSubService.bin PubSub/PubSubService.bin
cp PubSubService.abi PubSub/PubSubService.abi
mkdir -p tests
cp HelloWorldPublisher.bin tests/HelloWorldPublisher.bin
cp HelloWorldPublisher.abi tests/HelloWorldPublisher.abi
cp HelloWorldSubscriber.bin tests/HelloWorldSubscriber.bin
cp HelloWorldSubscriber.abi tests/HelloWorldSubscriber.abi
- name: Run publish gas cost evaluation
working-directory: ${{ env.PROJECT_DIR }}
run: |
python3 ${PROJECT_DIR}/tests/GasCostEvalMultiSubs.py
- name: Run subscribe gas cost evaluation
working-directory: ${{ env.PROJECT_DIR }}
run: |
python3 ${PROJECT_DIR}/tests/GasCostEvalMultiPubs.py
- name: Run deployment gas cost evaluation
working-directory: ${{ env.PROJECT_DIR }}
run: |
python3 ${PROJECT_DIR}/tests/GasCostEvalDeploy.py
- name: Plot gas cost evaluation result figures
working-directory: ${{ env.PROJECT_DIR }}
run: |
python3 ${PROJECT_DIR}/tests/GasCostEvalPlot.py
- name: Generate release note
working-directory: ${{ env.PROJECT_DIR }}/build
run: |
mkdir -p $(dirname ${RELE_NOTE})
echo "# Release note" >> ${RELE_NOTE}
echo "" >> ${RELE_NOTE}
echo "## Contracts" >> ${RELE_NOTE}
echo "- PubSub/EventManager.sol" >> ${RELE_NOTE}
echo "- PubSub/PubSubService.sol" >> ${RELE_NOTE}
echo "- tests/HelloWorldPublisher.sol" >> ${RELE_NOTE}
echo "- tests/HelloWorldSubscriber.sol" >> ${RELE_NOTE}
echo "" >> ${RELE_NOTE}
echo "## Build configurations" >> ${RELE_NOTE}
echo "- OS: \`${{ matrix.os }}\`" >> ${RELE_NOTE}
echo "- Solc version: \`$(bash -c "${SOLC_VER_CMD}")\`" >> ${RELE_NOTE}
echo "- Compiler Flags: \`${SOLC_FLAGS}\`" >> ${RELE_NOTE}
echo "" >> ${RELE_NOTE}
echo "## Checksums" >> ${RELE_NOTE}
echo "\`\`\`" >> ${RELE_NOTE}
cat checksums.txt >> ${RELE_NOTE}
echo "\`\`\`" >> ${RELE_NOTE}
echo "" >> ${RELE_NOTE}
echo "## Gas Cost Evaluations" >> ${RELE_NOTE}
echo "### Gas Cost of Publishing Events" >> ${RELE_NOTE}
echo "" >> ${RELE_NOTE}
echo '!'"[publish_gas_cost](/../../blob/assets-gas-eval/assets/${{ github.ref_name }}-publish_gas_cost.svg)" >> ${RELE_NOTE}
echo "" >> ${RELE_NOTE}
echo "### Gas Cost of Publisher Registeration" >> ${RELE_NOTE}
echo "" >> ${RELE_NOTE}
echo '!'"[register_gas_cost](/../../blob/assets-gas-eval/assets/${{ github.ref_name }}-register_gas_cost.svg)" >> ${RELE_NOTE}
echo "" >> ${RELE_NOTE}
echo "### Gas Cost of Subscribing to Publishers" >> ${RELE_NOTE}
echo "" >> ${RELE_NOTE}
echo '!'"[subscribe_gas_cost](/../../blob/assets-gas-eval/assets/${{ github.ref_name }}-subscribe_gas_cost.svg)" >> ${RELE_NOTE}
echo "" >> ${RELE_NOTE}
echo "### Gas Cost of Contract Deployment" >> ${RELE_NOTE}
echo "\`\`\`json" >> ${RELE_NOTE}
cat deploy_gas_cost.json >> ${RELE_NOTE}
echo "" >> ${RELE_NOTE}
echo "\`\`\`" >> ${RELE_NOTE}
echo "" >> ${RELE_NOTE}
echo "### Gas Cost Summary" >> ${RELE_NOTE}
echo "" >> ${RELE_NOTE}
echo '!'"[gas_cost](/../../blob/assets-gas-eval/assets/${{ github.ref_name }}-gas_cost.svg)" >> ${RELE_NOTE}
echo "" >> ${RELE_NOTE}
echo "" >> ${RELE_NOTE}
- name: Echo release note
run: |
cat ${RELE_NOTE}
- name: Release for anonymous repo
uses: actions/upload-artifact@v3
with:
name: anonymous_repo_release_pubsub_onchain
path: |
${{ env.PROJECT_DIR }}/build/release_note.md
${{ env.PROJECT_DIR }}/build/EventManager.bin
${{ env.PROJECT_DIR }}/build/EventManager.abi
${{ env.PROJECT_DIR }}/build/PubSubService.bin
${{ env.PROJECT_DIR }}/build/PubSubService.abi
${{ env.PROJECT_DIR }}/build/HelloWorldPublisher.bin
${{ env.PROJECT_DIR }}/build/HelloWorldPublisher.abi
${{ env.PROJECT_DIR }}/build/HelloWorldSubscriber.bin
${{ env.PROJECT_DIR }}/build/HelloWorldSubscriber.abi
${{ env.PROJECT_DIR }}/build/publish_gas_cost.svg
${{ env.PROJECT_DIR }}/build/publish_gas_cost.json
${{ env.PROJECT_DIR }}/build/subscribe_gas_cost.svg
${{ env.PROJECT_DIR }}/build/subscribe_gas_cost.json
${{ env.PROJECT_DIR }}/build/register_gas_cost.svg
${{ env.PROJECT_DIR }}/build/register_gas_cost.json
${{ env.PROJECT_DIR }}/build/deploy_gas_cost.json
${{ env.PROJECT_DIR }}/build/gas_cost.svg
create_release_ra_onchain:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-22.04 ]
python-version: [ 3.11 ]
node-version: [ 18.16.0 ]
ganache-version: [ 7.9.1 ]
solc-version: [ v0.8.21 ]
env:
SOLC_BIN: ${{ github.workspace }}/libs/ra-onchain/build/solc-static-linux
PROJECT_DIR: ${{ github.workspace }}/libs/ra-onchain
SOLC_FLAGS: >-
--optimize --optimize-runs 200
--revert-strings strip
--via-ir
--overwrite
--base-path ${{ github.workspace }}/libs/ra-onchain/
--output-dir ${{ github.workspace }}/libs/ra-onchain/build/
SOLC_VER_CMD: >-
${{ github.workspace }}/libs/ra-onchain/build/solc-static-linux
--version | tail -n 1 | sed -e "s/^Version: //g"
RELE_NOTE: ${{ github.workspace }}/libs/ra-onchain/build/release_note.md
name: create-release-ra-onchain
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Installing Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Installing Python packages
run: |
python3 -m pip install --requirement ${PROJECT_DIR}/utils/gas_cost_eval_requirements.txt
- name: Installing Node ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Installing NPM packages
run: |
npm install -g ganache@${{ matrix.ganache-version }}
- name: Installing Solc compiler
run: |
mkdir -p $(dirname ${SOLC_BIN})
curl -fsSL -o ${SOLC_BIN} \
https://github.com/ethereum/solidity/releases/download/${{ matrix.solc-version }}/solc-static-linux
chmod +x ${SOLC_BIN}
- name: Compiling contracts for contracts/IASRootCertMgr.sol
run: |
${SOLC_BIN} ${SOLC_FLAGS} --bin ${PROJECT_DIR}/contracts/IASRootCertMgr.sol
${SOLC_BIN} ${SOLC_FLAGS} --abi ${PROJECT_DIR}/contracts/IASRootCertMgr.sol
- name: Compiling contracts for contracts/IASReportCertMgr.sol
run: |
${SOLC_BIN} ${SOLC_FLAGS} --bin ${PROJECT_DIR}/contracts/IASReportCertMgr.sol
${SOLC_BIN} ${SOLC_FLAGS} --abi ${PROJECT_DIR}/contracts/IASReportCertMgr.sol
- name: Compiling contracts for contracts/DecentServerCertMgr.sol
run: |
${SOLC_BIN} ${SOLC_FLAGS} --bin ${PROJECT_DIR}/contracts/DecentServerCertMgr.sol
${SOLC_BIN} ${SOLC_FLAGS} --abi ${PROJECT_DIR}/contracts/DecentServerCertMgr.sol
- name: Compiling contracts for tests/HelloWorldApp.sol
run: |
${SOLC_BIN} ${SOLC_FLAGS} --bin ${PROJECT_DIR}/tests/HelloWorldApp.sol
${SOLC_BIN} ${SOLC_FLAGS} --abi ${PROJECT_DIR}/tests/HelloWorldApp.sol
- name: Prepare binaries for gas cost evaluation
working-directory: ${{ env.PROJECT_DIR }}/build/
run: |
mkdir -p contracts
cp IASRootCertMgr.bin contracts/IASRootCertMgr.bin
cp IASRootCertMgr.abi contracts/IASRootCertMgr.abi
cp IASReportCertMgr.bin contracts/IASReportCertMgr.bin
cp IASReportCertMgr.abi contracts/IASReportCertMgr.abi
cp DecentServerCertMgr.bin contracts/DecentServerCertMgr.bin
cp DecentServerCertMgr.abi contracts/DecentServerCertMgr.abi
mkdir -p tests
cp HelloWorldApp.bin tests/HelloWorldApp.bin
cp HelloWorldApp.abi tests/HelloWorldApp.abi
- name: Run gas cost evaluation
working-directory: ${{ env.PROJECT_DIR }}
run: |
python3 ${PROJECT_DIR}/utils/GanacheContractTests.py eval
- name: Calculating checksums of the binary
working-directory: ${{ env.PROJECT_DIR }}/build/
run: |
sha256sum solc-static-linux >> checksums.txt
sha256sum IASRootCertMgr.bin >> checksums.txt
sha256sum IASRootCertMgr.abi >> checksums.txt
sha256sum IASReportCertMgr.bin >> checksums.txt
sha256sum IASReportCertMgr.abi >> checksums.txt
sha256sum DecentServerCertMgr.bin >> checksums.txt
sha256sum DecentServerCertMgr.abi >> checksums.txt
sha256sum HelloWorldApp.bin >> checksums.txt
sha256sum HelloWorldApp.abi >> checksums.txt
- name: Generate release note
working-directory: ${{ env.PROJECT_DIR }}/build/
run: |
mkdir -p $(dirname ${RELE_NOTE})
echo "# Release note" >> ${RELE_NOTE}
echo "" >> ${RELE_NOTE}
echo "## Contracts" >> ${RELE_NOTE}
echo "- contracts/IASRootCertMgr.sol" >> ${RELE_NOTE}
echo "- contracts/IASReportCertMgr.sol" >> ${RELE_NOTE}
echo "- contracts/DecentServerCertMgr.sol" >> ${RELE_NOTE}
echo "- tests/HelloWorldApp.sol" >> ${RELE_NOTE}
echo "" >> ${RELE_NOTE}
echo "## Build configurations" >> ${RELE_NOTE}
echo "- OS: \`${{ matrix.os }}\`" >> ${RELE_NOTE}
echo "- Solc version: \`$(bash -c "${SOLC_VER_CMD}")\`" >> ${RELE_NOTE}
echo "- Compiler Flags: \`${SOLC_FLAGS}\`" >> ${RELE_NOTE}
echo "" >> ${RELE_NOTE}
echo "## Checksums" >> ${RELE_NOTE}
echo "\`\`\`" >> ${RELE_NOTE}
cat checksums.txt >> ${RELE_NOTE}
echo "\`\`\`" >> ${RELE_NOTE}
echo "" >> ${RELE_NOTE}
echo "## Gas Cost Evaluations" >> ${RELE_NOTE}
echo "\`\`\`json" >> ${RELE_NOTE}
cat gas_costs.json >> ${RELE_NOTE}
echo "" >> ${RELE_NOTE}
echo "\`\`\`" >> ${RELE_NOTE}
echo "" >> ${RELE_NOTE}
- name: Echo release note
run: |
cat ${RELE_NOTE}
- name: Release for anonymous repo
uses: actions/upload-artifact@v3
with:
name: anonymous_repo_release_ra_onchain
path: |
${{ env.PROJECT_DIR }}/build/release_note.md
${{ env.PROJECT_DIR }}/build/IASRootCertMgr.bin
${{ env.PROJECT_DIR }}/build/IASRootCertMgr.abi
${{ env.PROJECT_DIR }}/build/IASReportCertMgr.bin
${{ env.PROJECT_DIR }}/build/IASReportCertMgr.abi
${{ env.PROJECT_DIR }}/build/DecentServerCertMgr.bin
${{ env.PROJECT_DIR }}/build/DecentServerCertMgr.abi
${{ env.PROJECT_DIR }}/build/HelloWorldApp.bin
${{ env.PROJECT_DIR }}/build/HelloWorldApp.abi
${{ env.PROJECT_DIR }}/build/gas_costs.json
create_release_revoker_onchain:
needs: [create_release_pubsub_onchain, create_release_ra_onchain]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-22.04 ]
python-version: [ 3.11 ]
node-version: [ 18.16.0 ]
ganache-version: [ 7.9.1 ]
solc-version: [ v0.8.21 ]
env:
SOLC_BIN: ${{ github.workspace }}/revoker-onchain/build/solc-static-linux
PROJECT_DIR: ${{ github.workspace }}/revoker-onchain
SOLC_FLAGS: >-
--optimize --optimize-runs 200
--revert-strings strip
--via-ir
--overwrite
--allow-paths ${{ github.workspace }}
--base-path ${{ github.workspace }}/revoker-onchain
--output-dir ${{ github.workspace }}/revoker-onchain/build/
SOLC_VER_CMD: >-
${{ github.workspace }}/revoker-onchain/build/solc-static-linux
--version | tail -n 1 | sed -e "s/^Version: //g"
RELE_NOTE: ${{ github.workspace }}/revoker-onchain/build/release_note.md
PUBSUB_ARTIFACT_DIR: ${{ github.workspace }}/artifact/pubsub-onchain
RA_ARTIFACT_DIR: ${{ github.workspace }}/artifact/ra-onchain
name: create-release-revoker-onchain
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Installing Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Installing Python packages
run: |
python3 -m pip install --requirement ${PROJECT_DIR}/utils/gas_cost_eval_requirements.txt
- name: Installing Node ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Installing NPM packages
run: |
npm install -g ganache@${{ matrix.ganache-version }}
- name: Installing Solc compiler
run: |
mkdir -p $(dirname ${SOLC_BIN})
curl -fsSL -o ${SOLC_BIN} \
https://github.com/ethereum/solidity/releases/download/${{ matrix.solc-version }}/solc-static-linux
chmod +x ${SOLC_BIN}
- name: Compiling contracts for EnclaveRevoker/RevokerByVoting.sol
run: |
${SOLC_BIN} ${SOLC_FLAGS} --bin ${PROJECT_DIR}/EnclaveRevoker/RevokerByVoting.sol
${SOLC_BIN} ${SOLC_FLAGS} --abi ${PROJECT_DIR}/EnclaveRevoker/RevokerByVoting.sol
- name: Compiling contracts for EnclaveRevoker/RevokerByConflictMsg.sol
run: |
${SOLC_BIN} ${SOLC_FLAGS} --bin ${PROJECT_DIR}/EnclaveRevoker/RevokerByConflictMsg.sol
${SOLC_BIN} ${SOLC_FLAGS} --abi ${PROJECT_DIR}/EnclaveRevoker/RevokerByConflictMsg.sol
- name: Compiling contracts for EnclaveRevoker/RevokerByLeakedKey.sol
run: |
${SOLC_BIN} ${SOLC_FLAGS} --bin ${PROJECT_DIR}/EnclaveRevoker/RevokerByLeakedKey.sol
${SOLC_BIN} ${SOLC_FLAGS} --abi ${PROJECT_DIR}/EnclaveRevoker/RevokerByLeakedKey.sol
- name: Compiling contracts for KeyRevoker/KeyRevokerByVoting.sol
run: |
${SOLC_BIN} ${SOLC_FLAGS} --bin ${PROJECT_DIR}/KeyRevoker/KeyRevokerByVoting.sol
${SOLC_BIN} ${SOLC_FLAGS} --abi ${PROJECT_DIR}/KeyRevoker/KeyRevokerByVoting.sol
- name: Compiling contracts for KeyRevoker/KeyRevokerByConflictMsg.sol
run: |
${SOLC_BIN} ${SOLC_FLAGS} --bin ${PROJECT_DIR}/KeyRevoker/KeyRevokerByConflictMsg.sol
${SOLC_BIN} ${SOLC_FLAGS} --abi ${PROJECT_DIR}/KeyRevoker/KeyRevokerByConflictMsg.sol
- name: Compiling contracts for KeyRevoker/KeyRevokerByLeakedKey.sol
run: |
${SOLC_BIN} ${SOLC_FLAGS} --bin ${PROJECT_DIR}/KeyRevoker/KeyRevokerByLeakedKey.sol
${SOLC_BIN} ${SOLC_FLAGS} --abi ${PROJECT_DIR}/KeyRevoker/KeyRevokerByLeakedKey.sol
- name: Calculating checksums of the binary
working-directory: ${{ env.PROJECT_DIR }}/build
run: |
sha256sum solc-static-linux >> checksums.txt
sha256sum RevokerByVoting.bin >> checksums.txt
sha256sum RevokerByVoting.abi >> checksums.txt
sha256sum RevokerByConflictMsg.bin >> checksums.txt
sha256sum RevokerByConflictMsg.abi >> checksums.txt
sha256sum RevokerByLeakedKey.bin >> checksums.txt
sha256sum RevokerByLeakedKey.abi >> checksums.txt
sha256sum KeyRevokerByVoting.bin >> checksums.txt
sha256sum KeyRevokerByVoting.abi >> checksums.txt
sha256sum KeyRevokerByConflictMsg.abi >> checksums.txt
sha256sum KeyRevokerByConflictMsg.abi >> checksums.txt
sha256sum KeyRevokerByLeakedKey.abi >> checksums.txt
sha256sum KeyRevokerByLeakedKey.abi >> checksums.txt
- name: Prepare binaries for gas cost evaluation
working-directory: ${{ env.PROJECT_DIR }}/build
run: |
mkdir -p EnclaveRevoker
cp RevokerByVoting.bin EnclaveRevoker/RevokerByVoting.bin
cp RevokerByVoting.abi EnclaveRevoker/RevokerByVoting.abi
cp RevokerByConflictMsg.bin EnclaveRevoker/RevokerByConflictMsg.bin
cp RevokerByConflictMsg.abi EnclaveRevoker/RevokerByConflictMsg.abi
cp RevokerByLeakedKey.bin EnclaveRevoker/RevokerByLeakedKey.bin
cp RevokerByLeakedKey.abi EnclaveRevoker/RevokerByLeakedKey.abi
mkdir -p KeyRevoker
cp KeyRevokerByVoting.bin KeyRevoker/KeyRevokerByVoting.bin
cp KeyRevokerByVoting.abi KeyRevoker/KeyRevokerByVoting.abi
cp KeyRevokerByConflictMsg.bin KeyRevoker/KeyRevokerByConflictMsg.bin
cp KeyRevokerByConflictMsg.abi KeyRevoker/KeyRevokerByConflictMsg.abi
cp KeyRevokerByLeakedKey.bin KeyRevoker/KeyRevokerByLeakedKey.bin
cp KeyRevokerByLeakedKey.abi KeyRevoker/KeyRevokerByLeakedKey.abi
- name: Download pubsub onchain release
uses: actions/download-artifact@v3
with:
name: anonymous_repo_release_pubsub_onchain
path: ${{ env.PUBSUB_ARTIFACT_DIR }}
- name: Download ra onchain release
uses: actions/download-artifact@v3
with:
name: anonymous_repo_release_ra_onchain
path: ${{ env.RA_ARTIFACT_DIR }}
- name: List Downloaded Artifacts
run: |
ls -lah ${PUBSUB_ARTIFACT_DIR}
ls -lah ${RA_ARTIFACT_DIR}
- name: Install built contracts
working-directory: ${{ env.PROJECT_DIR }}
run: |
mkdir -p libs/PubSub/build/PubSub
mkdir -p libs/RA/build/contracts
cp ${{ env.PUBSUB_ARTIFACT_DIR }}/PubSubService.bin libs/PubSub/build/PubSub/PubSubService.bin
cp ${{ env.PUBSUB_ARTIFACT_DIR }}/PubSubService.abi libs/PubSub/build/PubSub/PubSubService.abi
cp ${{ env.RA_ARTIFACT_DIR }}/IASRootCertMgr.bin libs/RA/build/contracts/IASRootCertMgr.bin
cp ${{ env.RA_ARTIFACT_DIR }}/IASRootCertMgr.abi libs/RA/build/contracts/IASRootCertMgr.abi
cp ${{ env.RA_ARTIFACT_DIR }}/IASReportCertMgr.bin libs/RA/build/contracts/IASReportCertMgr.bin
cp ${{ env.RA_ARTIFACT_DIR }}/IASReportCertMgr.abi libs/RA/build/contracts/IASReportCertMgr.abi
cp ${{ env.RA_ARTIFACT_DIR }}/DecentServerCertMgr.bin libs/RA/build/contracts/DecentServerCertMgr.bin
cp ${{ env.RA_ARTIFACT_DIR }}/DecentServerCertMgr.abi libs/RA/build/contracts/DecentServerCertMgr.abi
- name: Run gas cost evaluation for EnclaveRevoker
working-directory: ${{ env.PROJECT_DIR }}
run: |
python3 ${PROJECT_DIR}/utils/GasEvalEnclaveRevoker.py
- name: Run gas cost evaluation for KeyRevoker
working-directory: ${{ env.PROJECT_DIR }}
run: |
python3 ${PROJECT_DIR}/utils/GasEvalKeyRevoker.py
- name: Generate release note
working-directory: ${{ env.PROJECT_DIR }}/build
run: |
echo "# Release note" >> ${RELE_NOTE}
echo "" >> ${RELE_NOTE}
echo "## Contracts" >> ${RELE_NOTE}
echo "- EnclaveRevoker/RevokerByVoting.sol" >> ${RELE_NOTE}
echo "- EnclaveRevoker/RevokerByConflictMsg.sol" >> ${RELE_NOTE}
echo "- EnclaveRevoker/RevokerByLeakedKey.sol" >> ${RELE_NOTE}
echo "- KeyRevoker/KeyRevokerByVoting.sol" >> ${RELE_NOTE}
echo "- KeyRevoker/KeyRevokerByConflictMsg.sol" >> ${RELE_NOTE}
echo "- KeyRevoker/KeyRevokerByLeakedKey.sol" >> ${RELE_NOTE}
echo "" >> ${RELE_NOTE}
echo "## Build configurations" >> ${RELE_NOTE}
echo "- OS: \`${{ matrix.os }}\`" >> ${RELE_NOTE}
echo "- Solc version: \`$(bash -c "${SOLC_VER_CMD}")\`" >> ${RELE_NOTE}
echo "- Compiler Flags: \`${SOLC_FLAGS}\`" >> ${RELE_NOTE}
echo "" >> ${RELE_NOTE}
echo "## Checksums" >> ${RELE_NOTE}
echo "\`\`\`" >> ${RELE_NOTE}
cat checksums.txt >> ${RELE_NOTE}
echo "\`\`\`" >> ${RELE_NOTE}
echo "" >> ${RELE_NOTE}
echo "## Gas Cost Evaluations" >> ${RELE_NOTE}
echo "" >> ${RELE_NOTE}
echo "### Enclave Revoker" >> ${RELE_NOTE}
echo "\`\`\`json" >> ${RELE_NOTE}
cat gas_cost_decent_revoker.json >> ${RELE_NOTE}
echo "" >> ${RELE_NOTE}
echo "\`\`\`" >> ${RELE_NOTE}
echo "" >> ${RELE_NOTE}
echo "### Key Revoker" >> ${RELE_NOTE}
echo "\`\`\`json" >> ${RELE_NOTE}
cat gas_cost_key_revoker.json >> ${RELE_NOTE}
echo "" >> ${RELE_NOTE}
echo "\`\`\`" >> ${RELE_NOTE}
echo "" >> ${RELE_NOTE}
- name: Echo release note
run: |
cat ${RELE_NOTE}
- name: Release for anonymous repo
uses: actions/upload-artifact@v3
with:
name: anonymous_repo_release_revoker_onchain
path: |
${{ env.PROJECT_DIR }}/build/release_note.md
${{ env.PROJECT_DIR }}/build/RevokerByVoting.bin
${{ env.PROJECT_DIR }}/build/RevokerByVoting.abi
${{ env.PROJECT_DIR }}/build/RevokerByConflictMsg.bin
${{ env.PROJECT_DIR }}/build/RevokerByConflictMsg.abi
${{ env.PROJECT_DIR }}/build/RevokerByLeakedKey.bin
${{ env.PROJECT_DIR }}/build/RevokerByLeakedKey.abi
${{ env.PROJECT_DIR }}/build/KeyRevokerByVoting.bin
${{ env.PROJECT_DIR }}/build/KeyRevokerByVoting.abi
${{ env.PROJECT_DIR }}/build/KeyRevokerByConflictMsg.bin
${{ env.PROJECT_DIR }}/build/KeyRevokerByConflictMsg.abi
${{ env.PROJECT_DIR }}/build/KeyRevokerByLeakedKey.bin
${{ env.PROJECT_DIR }}/build/KeyRevokerByLeakedKey.abi