@@ -181,12 +181,43 @@ jobs:
181
181
- name : Install dependencies
182
182
run : yarn install --frozen-lockfile
183
183
184
- # TODO: Configure tenderly
184
+ - name : Get upstream packages versions
185
+ uses : keep-network/ci/actions/upstream-builds-query@v1
186
+ id : upstream-builds-query
187
+ with :
188
+ upstream-builds : ${{ github.event.inputs.upstream_builds }}
189
+ query : |
190
+ solidity-contracts-version = github.com/threshold-network/solidity-contracts#version
191
+ random-beacon-version = github.com/keep-network/keep-core/solidity/random-beacon#version
185
192
186
- - name : Deploy contracts
193
+ - name : Resolve latest contracts
194
+ run : |
195
+ yarn upgrade \
196
+ @threshold-network/solidity-contracts@${{ steps.upstream-builds-query.outputs.solidity-contracts-version }} \
197
+ @keep-network/random-beacon@${{ steps.upstream-builds-query.outputs.random-beacon-version }} \
198
+ @keep-network/sortition-pools
199
+
200
+ - name : Configure tenderly
201
+ env :
202
+ TENDERLY_TOKEN : ${{ secrets.TENDERLY_TOKEN }}
203
+ run : ./config_tenderly.sh
204
+
205
+ # Ultimately, we want to get rid of steps deploying on Ropsten (as it will
206
+ # be shut down in Q4 2022) and switch to deployment on Goerli. We're
207
+ # leaving both deployment options for the transition period.
208
+
209
+ - name : Deploy contracts on Ropsten
210
+ if : github.event.inputs.environment == 'ropsten'
211
+ env :
212
+ CHAIN_API_URL : ${{ secrets.ROPSTEN_ETH_HOSTNAME_HTTP }}
213
+ CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY : ${{ secrets.ROPSTEN_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
214
+ run : yarn deploy --network ${{ github.event.inputs.environment }}
215
+
216
+ - name : Deploy contracts on Goerli
217
+ if : github.event.inputs.environment == 'goerli'
187
218
env :
188
- CHAIN_API_URL : ${{ secrets.KEEP_TEST_ETH_HOSTNAME_HTTP }}
189
- CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY : ${{ secrets.KEEP_TEST_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
219
+ CHAIN_API_URL : ${{ secrets.GOERLI_ETH_HOSTNAME_HTTP }}
220
+ CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY : ${{ secrets.GOERLI_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
190
221
run : yarn deploy --network ${{ github.event.inputs.environment }}
191
222
192
223
- name : Bump up package version
@@ -201,6 +232,69 @@ jobs:
201
232
- name : Publish to npm
202
233
env :
203
234
NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
204
- run : npm publish --access=public --tag ${{ github.event.inputs.environment }} --network=${{ github.event.inputs.environment }}
235
+ # TODO: remove `--dry-run` before merge to main
236
+ run : npm publish --access=public --tag ${{ github.event.inputs.environment }} --network=${{ github.event.inputs.environment }} --dry-run
205
237
206
- # TODO: Notify CI about completion of the workflow
238
+ # TODO: restore commented out `uses` config before merge to `main``
239
+ - name : Notify CI about completion of the workflow
240
+ # uses: keep-network/ci/actions/notify-workflow-completed@v1
241
+ uses : keep-network/ci/actions/notify-workflow-completed@ci-goerli
242
+ env :
243
+ GITHUB_TOKEN : ${{ secrets.CI_GITHUB_TOKEN }}
244
+ with :
245
+ module : " github.com/keep-network/keep-core/solidity/ecdsa"
246
+ url : https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
247
+ environment : ${{ github.event.inputs.environment }}
248
+ upstream_builds : ${{ github.event.inputs.upstream_builds }}
249
+ upstream_ref : ${{ github.event.inputs.upstream_ref }}
250
+ version : ${{ steps.npm-version-bump.outputs.version }}
251
+
252
+ - name : Upload files needed for etherscan verification
253
+ uses : actions/upload-artifact@v2
254
+ with :
255
+ name : Artifacts for etherscan verifcation
256
+ path : |
257
+ ./solidity/ecdsa/deployments
258
+ ./solidity/ecdsa/package.json
259
+ ./solidity/ecdsa/yarn.lock
260
+
261
+ contracts-etherscan-verification :
262
+ needs : [contracts-deployment-testnet]
263
+ runs-on : ubuntu-latest
264
+ defaults :
265
+ run :
266
+ working-directory : ./solidity/ecdsa
267
+ steps :
268
+ - uses : actions/checkout@v2
269
+
270
+ - name : Download files needed for etherscan verification
271
+ uses : actions/download-artifact@v2
272
+ with :
273
+ name : Artifacts for etherscan verifcation
274
+
275
+ - uses : actions/setup-node@v2
276
+ with :
277
+ node-version : " 14.x"
278
+ cache : " yarn"
279
+ cache-dependency-path : solidity/ecdsa/yarn.lock
280
+
281
+ - name : Install needed dependencies
282
+ run : yarn install --frozen-lockfile
283
+
284
+ # If we don't remove the `keep-core` contracts from `node-modules`, the
285
+ # `etherscan-verify` plugins tries to verify them, which is not desired.
286
+ - name : Prepare for verification on Etherscan
287
+ run : |
288
+ rm -rf ./node_modules/@keep-network/keep-core
289
+ rm -rf ./node_modules/@keep-network/random-beacon
290
+ rm -rf ./node_modules/@keep-network/sortition-pools
291
+ rm -rf ./node_modules/@threshold-network/solidity-contracts
292
+ rm -rf ./external/npm
293
+
294
+ - name : Verify contracts on Etherscan
295
+ env :
296
+ ETHERSCAN_API_KEY : ${{ secrets.ETHERSCAN_API_KEY }}
297
+ CHAIN_API_URL : ${{ secrets.ROPSTEN_ETH_HOSTNAME_HTTP }}
298
+ run : |
299
+ yarn run hardhat --network ${{ github.event.inputs.environment }} \
300
+ etherscan-verify --license GPL-3.0 --force-license
0 commit comments