-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (86 loc) · 3.05 KB
/
Copy pathpublish-circuits.yml
File metadata and controls
96 lines (86 loc) · 3.05 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
name: Publish Circuits
# Triggered manually by adding the 'trigger-upload-circuits' label to a PR.
# Recompiles all 6 circuits, uploads artifacts to S3, and posts a comment
# with download instructions.
on:
pull_request:
types: [labeled]
permissions:
contents: read
issues: write
pull-requests: write
concurrency:
group: circuits-upload-pr-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
upload:
if: >-
${{
github.event_name == 'pull_request' &&
github.event.action == 'labeled' &&
github.event.label.name == 'trigger-upload-circuits' &&
github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name
}}
runs-on: ubuntu-latest
timeout-minutes: 120
env:
LOG_LEVEL: debug
steps:
- name: Remove PR label
uses: actions/github-script@v7
with:
script: |
try {
await github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
name: 'trigger-upload-circuits',
});
} catch (err) {
core.warning(`Failed to remove label: ${err.message}`);
}
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: false
- name: Compile circuits and upload to S3
env:
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }}
run: |
go run ./cmd/circuit-compile/... \
--destination ~/.davinci/artifacts \
--verifiers-dir solidity/src/verifiers
- name: Store circuit artifact config
uses: actions/upload-artifact@v4
with:
name: davinci-dkg-circuits-config
path: |
config/circuit_artifacts.go
solidity/src/verifiers/contribution_vkey.sol
solidity/src/verifiers/finalize_vkey.sol
solidity/src/verifiers/partialdecrypt_vkey.sol
solidity/src/verifiers/decryptcombine_vkey.sol
solidity/src/verifiers/revealsubmit_vkey.sol
solidity/src/verifiers/revealshare_vkey.sol
- name: Comment on PR
uses: actions/github-script@v7
with:
script: |
const runId = context.runId || process.env.GITHUB_RUN_ID || 'UNKNOWN_RUN_ID';
const body =
`Circuit artifact upload finished.\n\n` +
`Download the updated config files:\n\n` +
`\`\`\`bash\n` +
`gh run download ${runId} -R ${context.repo.owner}/${context.repo.repo} -n davinci-dkg-circuits-config\n` +
`\`\`\`\n`;
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
body,
});