1010 workflow_dispatch :
1111 inputs :
1212 environment :
13- description : " Environment for workflow execution"
14- required : false
15- default : " dev"
13+ description : " Environment (network) for workflow execution, e.g. `sepolia`"
14+ required : true
1615 upstream_builds :
1716 description : " Upstream builds"
1817 required : false
2524 contracts-build-and-test :
2625 runs-on : ubuntu-latest
2726 steps :
28- - uses : actions/checkout@v2
27+ - uses : actions/checkout@v3
2928
30- - uses : actions/setup-node@v2
29+ - uses : actions/setup-node@v3
3130 with :
3231 node-version : " 14.x"
3332 cache : " yarn"
5049 runs-on : ubuntu-latest
5150 if : github.event_name != 'schedule'
5251 steps :
53- - uses : actions/checkout@v2
52+ - uses : actions/checkout@v3
5453
55- - uses : actions/setup-node@v2
54+ - uses : actions/setup-node@v3
5655 with :
5756 node-version : " 14.x"
5857 cache : " yarn"
7776 if : github.event_name == 'workflow_dispatch'
7877 runs-on : ubuntu-latest
7978 steps :
80- - uses : actions/checkout@v2
79+ - uses : actions/checkout@v3
8180
82- - uses : actions/setup-node@v2
81+ - uses : actions/setup-node@v3
8382 with :
8483 node-version : " 14.x"
8584 cache : " yarn"
@@ -98,30 +97,33 @@ jobs:
9897 run : yarn install --frozen-lockfile
9998
10099 - name : Get upstream packages' versions
101- uses : keep-network/ci/actions/upstream-builds-query@v1
100+ uses : keep-network/ci/actions/upstream-builds-query@v2
102101 id : upstream-builds-query
103102 with :
104103 upstream-builds : ${{ github.event.inputs.upstream_builds }}
105104 query : |
105+ threshold-contracts-version = github.com/threshold-network/solidity-contracts#version
106106 keep-core-contracts-version = github.com/keep-network/keep-core/solidity-v1#version
107107 tbtc-contracts-version = github.com/keep-network/tbtc/solidity#version
108108
109109 - name : Resolve latest contracts
110110 run : |
111111 yarn upgrade \
112- @keep-network/keep-core@${{ steps.upstream-builds-query.outputs.keep-core-contracts-version }} \
113- @keep-network/tbtc@${{ steps.upstream-builds-query.outputs.tbtc-contracts-version }}
114-
115- - name : Configure tenderly
116- if : github.event.inputs.environment == 'ropsten'
117- env :
118- TENDERLY_TOKEN : ${{ secrets.TENDERLY_TOKEN }}
119- run : ./config_tenderly.sh
112+ @threshold-network/solidity-contracts@${{ steps.upstream-builds-query.outputs.threshold-contracts-version }} \
113+ @keep-network/keep-core@${{ github.event.inputs.environment }} \
114+ @keep-network/tbtc@${{ github.event.inputs.environment }}
120115
121116 - name : Deploy contracts
122117 env :
123- CHAIN_API_URL : ${{ secrets.KEEP_TEST_ETH_HOSTNAME_HTTP }}
124- CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY : ${{ secrets.KEEP_TEST_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
118+ # Using fake ternary expression to decide which credentials to use,
119+ # depending on chosen environment. Note: if `GOERLI_ETH_HOSTNAME_HTTP`
120+ # is empty, the expression will be evaluated to
121+ # `SEPOLIA_ETH_HOSTNAME_HTTP`'s value.
122+ CHAIN_API_URL : |
123+ ${{ inputs.github.event.inputs.environment == 'goerli'
124+ && secrets.GOERLI_ETH_HOSTNAME_HTTP
125+ || secrets.SEPOLIA_ETH_HOSTNAME_HTTP }}
126+ ACCOUNTS_PRIVATE_KEYS : ${{ secrets.TESTNET_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
125127 run : yarn deploy --network ${{ github.event.inputs.environment }}
126128
127129 - name : Bump up package version
@@ -135,10 +137,10 @@ jobs:
135137 - name : Publish to npm
136138 env :
137139 NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
138- run : npm publish --access=public --network= ${{ github.event.inputs.environment }} --tag ${{ github.event.inputs.environment }}
140+ run : npm publish --access=public --tag ${{ github.event.inputs.environment }} --network= ${{ github.event.inputs.environment }}
139141
140142 - name : Notify CI about completion of the workflow
141- uses : keep-network/ci/actions/notify-workflow-completed@v1
143+ uses : keep-network/ci/actions/notify-workflow-completed@v2
142144 env :
143145 GITHUB_TOKEN : ${{ secrets.CI_GITHUB_TOKEN }}
144146 with :
@@ -149,66 +151,15 @@ jobs:
149151 upstream_ref : ${{ github.event.inputs.upstream_ref }}
150152 version : ${{ steps.npm-version-bump.outputs.version }}
151153
152- - name : Upload files needed for etherscan verification
153- uses : actions/upload-artifact@v2
154- with :
155- name : Artifacts for etherscan verifcation
156- path : |
157- ./deployments
158- ./package.json
159- ./yarn.lock
160-
161- contracts-etherscan-verification :
162- needs : [contracts-deployment-testnet]
163- runs-on : ubuntu-latest
164- steps :
165- - uses : actions/checkout@v2
166-
167- - name : Download files needed for etherscan verification
168- uses : actions/download-artifact@v2
169- with :
170- name : Artifacts for etherscan verifcation
171-
172- - uses : actions/setup-node@v2
173- with :
174- node-version : " 14.x"
175- cache : " yarn"
176-
177- # This step forces Git to download dependencies using `https://` protocol,
178- # even if `yarn.json` refers to some package via `git://`. Using `git://`
179- # is no longer supported by GH. One of the `coverage-pools` dependencies
180- # by default uses `git://` and we needed to manually remove it every time
181- # it re-appeares in the lock file. Now even if it does re-appear, the
182- # `yarn install --frozen-lockfile` will not fail.
183- - name : Configure git to don't use unauthenticated protocol
184- run : git config --global url."https://".insteadOf git://
185-
186- - name : Install needed dependencies
187- run : yarn install --frozen-lockfile
188-
189- # If we don't remove the dependencies' contracts from `node-modules`, the
190- # `etherscan-verify` plugins tries to verify them, which is not desired.
191- - name : Prepare for verification on Etherscan
192- run : |
193- rm -rf ./node_modules/@keep-network/keep-core
194- rm -rf ./node_modules/@keep-network/tbtc
195- rm -rf ./node_modules/@threshold-network/solidity-contracts
196-
197- - name : Verify contracts on Etherscan
198- env :
199- ETHERSCAN_API_KEY : ${{ secrets.ETHERSCAN_API_KEY }}
200- CHAIN_API_URL : ${{ secrets.KEEP_TEST_ETH_HOSTNAME_HTTP }}
201- run : yarn run hardhat --network ${{ github.event.inputs.environment }} etherscan-verify --license MIT
202-
203154 contracts-lint :
204155 runs-on : ubuntu-latest
205156 if : |
206157 github.event_name != 'workflow_dispatch'
207158 && github.event_name != 'schedule'
208159 steps :
209- - uses : actions/checkout@v2
160+ - uses : actions/checkout@v3
210161
211- - uses : actions/setup-node@v2
162+ - uses : actions/setup-node@v3
212163 with :
213164 node-version : " 14.x"
214165 cache : " yarn"
@@ -234,14 +185,14 @@ jobs:
234185 github.event_name != 'workflow_dispatch'
235186 && github.event_name != 'schedule'
236187 steps :
237- - uses : actions/checkout@v2
188+ - uses : actions/checkout@v3
238189
239- - uses : actions/setup-node@v2
190+ - uses : actions/setup-node@v3
240191 with :
241192 node-version : " 14.x"
242193 cache : " yarn"
243194
244- - uses : actions/setup-python@v2
195+ - uses : actions/setup-python@v4
245196 with :
246197 python-version : 3.10.8
247198
0 commit comments