From 6f5ad4ff14506f890c3ceea173116861c1c7dec8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michalina=20Ciencia=C5=82a?= Date: Thu, 4 Aug 2022 09:29:03 +0200 Subject: [PATCH] Add support for deployment on Goerli testnet MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Görli became a recommended test network after Ropsten's deprecation notice (https://blog.ethereum.org/2022/06/21/testnet-deprecation/). We're modifying GitHub Actions workflow for deploying `coverage-pools` contracts to support the deployment on Görli. NOTE: We're temporarily using some testing configuration in the workflow, which needs to be removed before merge to `main`. --- .github/workflows/contracts.yml | 51 ++++++++++++++++----------------- 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/.github/workflows/contracts.yml b/.github/workflows/contracts.yml index 0dd8a1f5..39ee2252 100644 --- a/.github/workflows/contracts.yml +++ b/.github/workflows/contracts.yml @@ -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 @@ -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