diff --git a/.github/workflows/contracts.yaml b/.github/workflows/contracts.yaml index fce2121f..8b22ca4f 100644 --- a/.github/workflows/contracts.yaml +++ b/.github/workflows/contracts.yaml @@ -81,24 +81,24 @@ jobs: FORKING_URL: ${{ secrets.MAINNET_ETH_HOSTNAME_HTTP }} run: yarn test:system - contracts-deployment-dry-run: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 + # contracts-deployment-dry-run: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 - with: - node-version: "14.x" - cache: "yarn" + # - uses: actions/setup-node@v2 + # with: + # node-version: "14.x" + # cache: "yarn" - - name: Install dependencies - run: yarn install + # - name: Install dependencies + # run: yarn install - - name: Deploy contracts - run: yarn deploy + # - name: Deploy contracts + # run: yarn deploy contracts-deployment-testnet: - needs: [contracts-build-and-test] + # needs: [contracts-build-and-test] if: github.event_name == 'workflow_dispatch' runs-on: ubuntu-latest steps: @@ -137,13 +137,13 @@ jobs: KEEP_CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY: ${{ secrets.ROPSTEN_KEEP_ETH_CONTRACT_OWNER_PRIVATE_KEY }} run: yarn deploy --network ${{ github.event.inputs.environment }} - - name: Deploy contracts on Goerli - if: github.event.inputs.environment == 'goerli' - env: - CHAIN_API_URL: ${{ secrets.GOERLI_ETH_HOSTNAME_HTTP }} - CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY: ${{ secrets.GOERLI_ETH_CONTRACT_OWNER_PRIVATE_KEY }} - KEEP_CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY: ${{ secrets.GOERLI_KEEP_ETH_CONTRACT_OWNER_PRIVATE_KEY }} - run: yarn deploy --network ${{ github.event.inputs.environment }} + # - name: Deploy contracts on Goerli + # if: github.event.inputs.environment == 'goerli' + # env: + # CHAIN_API_URL: ${{ secrets.GOERLI_ETH_HOSTNAME_HTTP }} + # CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY: ${{ secrets.GOERLI_ETH_CONTRACT_OWNER_PRIVATE_KEY }} + # KEEP_CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY: ${{ secrets.GOERLI_KEEP_ETH_CONTRACT_OWNER_PRIVATE_KEY }} + # run: yarn deploy --network ${{ github.event.inputs.environment }} - name: Bump up package version id: npm-version-bump @@ -154,100 +154,105 @@ jobs: commit: ${{ github.sha }} - name: Publish to npm + # TOD: remove continue-on-error before merge to main + continue-on-error: true env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} # TODO: remove `--dry-run` before merge to main run: npm publish --access=public --network ${{ github.event.inputs.environment }} --tag ${{ github.event.inputs.environment }} --dry-run - # TODO: restore commented out `uses` config before merge to `main`` - - name: Notify CI about completion of the workflow - # uses: keep-network/ci/actions/notify-workflow-completed@v1 - uses: keep-network/ci/actions/notify-workflow-completed@ci-goerli - env: - GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }} - with: - module: "github.com/threshold-network/solidity-contracts" - 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 }} + # # TODO: restore commented out `uses` config before merge to `main`` + # - name: Notify CI about completion of the workflow + # # uses: keep-network/ci/actions/notify-workflow-completed@v1 + # uses: keep-network/ci/actions/notify-workflow-completed@ci-goerli + # env: + # GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }} + # with: + # module: "github.com/threshold-network/solidity-contracts" + # 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 with: name: Artifacts for etherscan verifcation + # path: | + # ./deployments + # ./package.json + # ./yarn.lock path: | - ./deployments ./package.json ./yarn.lock - contracts-etherscan-verification: - needs: [contracts-deployment-testnet] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Download files needed for etherscan verification - uses: actions/download-artifact@v2 - with: - name: Artifacts for etherscan verifcation - - - uses: actions/setup-node@v2 - with: - node-version: "14.x" - cache: "yarn" - - - name: Install needed dependencies - run: yarn install --frozen-lockfile - - # If we don't remove the `keep-core` contracts from `node-modules`, the - # `etherscan-verify` plugins tries to verify them, which is not desired. - - name: Prepare for verification on Etherscan - run: | - rm -rf ./node_modules/@keep-network/keep-core - rm -rf ./external/npm - - - name: Verify contracts on Etherscan - env: - ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }} - CHAIN_API_URL: ${{ secrets.ROPSTEN_ETH_HOSTNAME_HTTP }} - run: | - yarn run hardhat --network ${{ github.event.inputs.environment }} \ - etherscan-verify --license GPL-3.0 --force-license - - contracts-slither: - runs-on: ubuntu-latest - if: | - github.event_name != 'workflow_dispatch' - && github.event_name != 'schedule' - steps: - - uses: actions/checkout@v2 - - - uses: actions/setup-node@v2 - with: - node-version: "14" - cache: "yarn" - - - uses: actions/setup-python@v2 - with: - python-version: 3.8.5 - - - name: Install Solidity - env: - SOLC_VERSION: 0.8.9 # according to solidity.version in hardhat.config.ts - run: | - pip3 install solc-select - solc-select install $SOLC_VERSION - solc-select use $SOLC_VERSION - - - name: Install Slither - env: - SLITHER_VERSION: 0.8.0 - run: pip3 install slither-analyzer==$SLITHER_VERSION - - - name: Install dependencies - run: yarn install - - - name: Run Slither - run: slither . + # contracts-etherscan-verification: + # needs: [contracts-deployment-testnet] + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v2 + + # - name: Download files needed for etherscan verification + # uses: actions/download-artifact@v2 + # with: + # name: Artifacts for etherscan verifcation + + # - uses: actions/setup-node@v2 + # with: + # node-version: "14.x" + # cache: "yarn" + + # - name: Install needed dependencies + # run: yarn install --frozen-lockfile + + # # If we don't remove the `keep-core` contracts from `node-modules`, the + # # `etherscan-verify` plugins tries to verify them, which is not desired. + # - name: Prepare for verification on Etherscan + # run: | + # rm -rf ./node_modules/@keep-network/keep-core + # rm -rf ./external/npm + + # - name: Verify contracts on Etherscan + # env: + # ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }} + # CHAIN_API_URL: ${{ secrets.ROPSTEN_ETH_HOSTNAME_HTTP }} + # run: | + # yarn run hardhat --network ${{ github.event.inputs.environment }} \ + # etherscan-verify --license GPL-3.0 --force-license + + # contracts-slither: + # runs-on: ubuntu-latest + # if: | + # github.event_name != 'workflow_dispatch' + # && github.event_name != 'schedule' + # steps: + # - uses: actions/checkout@v2 + + # - uses: actions/setup-node@v2 + # with: + # node-version: "14" + # cache: "yarn" + + # - uses: actions/setup-python@v2 + # with: + # python-version: 3.8.5 + + # - name: Install Solidity + # env: + # SOLC_VERSION: 0.8.9 # according to solidity.version in hardhat.config.ts + # run: | + # pip3 install solc-select + # solc-select install $SOLC_VERSION + # solc-select use $SOLC_VERSION + + # - name: Install Slither + # env: + # SLITHER_VERSION: 0.8.0 + # run: pip3 install slither-analyzer==$SLITHER_VERSION + + # - name: Install dependencies + # run: yarn install + + # - name: Run Slither + # run: slither .