Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 25 additions & 28 deletions .github/workflows/contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,31 +79,21 @@ jobs:
- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Get upstream packages' versions
uses: keep-network/ci/actions/upstream-builds-query@v1
id: upstream-builds-query
with:
upstream-builds: ${{ github.event.inputs.upstream_builds }}
query: |
keep-core-contracts-version = github.com/keep-network/keep-core/solidity-v1#version
tbtc-contracts-version = github.com/keep-network/tbtc/solidity#version

- name: Resolve latest contracts
run: |
yarn upgrade \
@keep-network/keep-core@${{ steps.upstream-builds-query.outputs.keep-core-contracts-version }} \
@keep-network/tbtc@${{ steps.upstream-builds-query.outputs.tbtc-contracts-version }}
@keep-network/keep-core@${{ github.event.inputs.environment }} \
@keep-network/tbtc@${{ github.event.inputs.environment }}

- name: Configure tenderly
if: github.event.inputs.environment == 'ropsten'
env:
TENDERLY_TOKEN: ${{ secrets.TENDERLY_TOKEN }}
run: ./config_tenderly.sh

- name: Deploy contracts
env:
CHAIN_API_URL: ${{ secrets.KEEP_TEST_ETH_HOSTNAME_HTTP }}
ACCOUNTS_PRIVATE_KEYS: ${{ secrets.KEEP_TEST_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
CHAIN_API_URL: ${{ secrets.GOERLI_ETH_HOSTNAME_HTTP }}
ACCOUNTS_PRIVATE_KEYS: ${{ secrets.GOERLI_ETH_CONTRACT_OWNER_PRIVATE_KEY }}
run: yarn deploy --network ${{ github.event.inputs.environment }}

- name: Bump up package version
Expand All @@ -115,21 +105,28 @@ jobs:
commit: ${{ github.sha }}

- name: Publish to npm
# TODO: remove `--dry-run` before merge to main
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish --access=public --network=${{ github.event.inputs.environment }} --tag ${{ github.event.inputs.environment }}

- name: Notify CI about completion of the workflow
uses: keep-network/ci/actions/notify-workflow-completed@v1
env:
GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }}
with:
module: "github.com/keep-network/coverage-pools"
url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
environment: ${{ github.event.inputs.environment }}
upstream_builds: ${{ github.event.inputs.upstream_builds }}
upstream_ref: ${{ github.event.inputs.upstream_ref }}
version: ${{ steps.npm-version-bump.outputs.version }}
run: npm publish --access=public --network=${{ github.event.inputs.environment }} --tag ${{ github.event.inputs.environment }} --dry-run

# We're systematically moving to the v2 of the system, where different
# order of execution of modules is needed than in v1. `coverage-pools` are
# not yet ready to be included in the new (v2) CI flow. And the old (v1)
# deployment flow is now deprecated. Once coverage-pools get adjusted for
# the use in T dashboard, we'll need to uncomment this step and modify it
# for v2.
# - name: Notify CI about completion of the workflow
# uses: keep-network/ci/actions/notify-workflow-completed@v1
# env:
# GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }}
# with:
# module: "github.com/keep-network/coverage-pools"
# url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
# environment: ${{ github.event.inputs.environment }}
# upstream_builds: ${{ github.event.inputs.upstream_builds }}
# upstream_ref: ${{ github.event.inputs.upstream_ref }}
# version: ${{ steps.npm-version-bump.outputs.version }}

- name: Upload files needed for etherscan verification
uses: actions/upload-artifact@v2
Expand Down Expand Up @@ -170,7 +167,7 @@ jobs:
- name: Verify contracts on Etherscan
env:
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
CHAIN_API_URL: ${{ secrets.KEEP_TEST_ETH_HOSTNAME_HTTP }}
CHAIN_API_URL: ${{ secrets.GOERLI_ETH_HOSTNAME_HTTP }}
run: yarn run hardhat --network ${{ github.event.inputs.environment }} etherscan-verify --license MIT

contracts-lint:
Expand Down