-
Notifications
You must be signed in to change notification settings - Fork 261
77 lines (64 loc) · 2.62 KB
/
handler.deploy-to-testnets.yml
File metadata and controls
77 lines (64 loc) · 2.62 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
name: Deploy to Testnets
on:
workflow_dispatch:
inputs:
release_version:
description: 'Protocol release version (test/master/v1/etc.)'
required: true
default: 'test'
only_network:
description: 'Only a specific network is to be deployed'
required: false
environments:
description: 'Additional env vars, separated by semicolons'
required: false
jobs:
deploy-to-testnets:
name: Deploy to testnets
runs-on: ubuntu-22.04
env:
RELEASE_VERSION: ${{ github.event.inputs.release_version }}
DEFAULT_MNEMONIC: ${{ secrets.BUILD_AGENT_MNEMONIC }}
PROVIDER_URL_TEMPLATE: ${{ secrets.PROVIDER_URL_TEMPLATE }}
defaults:
run:
shell: nix develop .#ci-default -c bash -xe {0}
strategy:
fail-fast: false
matrix:
network: [eth-sepolia, optimism-sepolia, avalanche-fuji, scroll-sepolia]
steps:
- uses: actions/checkout@v4
# if only_network is set, skip all steps until the value matches one of the entries in matrix.network
- name: Check only_network
if: ${{ github.event.inputs.only_network != '' && github.event.inputs.only_network != matrix.network }}
run: echo "DO_SKIP=1" >> "$GITHUB_ENV"
- uses: cachix/install-nix-action@v27
if: env.DO_SKIP != 1
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Build
if: env.DO_SKIP != 1
run: |
yarn install --frozen-lockfile
yarn build-for-contracts-dev
- name: Deploy to ${{ matrix.network }}
if: env.DO_SKIP != 1
run: |
cd packages/ethereum-contracts
echo "${{ github.event.inputs.environments }}" | sed 's/;/\n/' > .env
npx truffle exec --network ${{ matrix.network }} ops-scripts/deploy-test-environment.js
- name: Etherscan verification of ${{ matrix.network }} deployment
if: env.DO_SKIP != 1
run: |
cd packages/ethereum-contracts
echo "${{ github.event.inputs.environments }}" | sed 's/;/\n/' > .env
npx truffle exec --network ${{ matrix.network }} ops-scripts/info-print-contract-addresses.js : addresses.vars
tasks/etherscan-verify-framework.sh ${{ matrix.network }} addresses.vars
env:
SKIP_IF_UNSUPPORTED: 1
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
POLYGONSCAN_API_KEY: ${{ secrets.POLYGONSCAN_API_KEY }}
SNOWTRACE_API_KEY: ${{ secrets.SNOWTRACE_API_KEY }}
OPTIMISTIC_API_KEY: ${{ secrets.OPTIMISTIC_API_KEY }}
ARBISCAN_API_KEY: ${{ secrets.ARBISCAN_API_KEY }}