From 3cafecb7662cef5c72920db34b1a623af3b2ec41 Mon Sep 17 00:00:00 2001 From: Lev Akhnazarov Date: Fri, 12 Dec 2025 14:16:47 +0000 Subject: [PATCH 1/7] remove workflow completely --- .github/workflows/contracts-ecdsa.yml | 352 ------------------ .github/workflows/contracts-random-beacon.yml | 346 ----------------- 2 files changed, 698 deletions(-) delete mode 100644 .github/workflows/contracts-ecdsa.yml delete mode 100644 .github/workflows/contracts-random-beacon.yml diff --git a/.github/workflows/contracts-ecdsa.yml b/.github/workflows/contracts-ecdsa.yml deleted file mode 100644 index 7ec449b67c..0000000000 --- a/.github/workflows/contracts-ecdsa.yml +++ /dev/null @@ -1,352 +0,0 @@ -name: Solidity ECDSA - -on: - # We intend to use `workflow dispatch` in two different situations/paths: - # 1. If a workflow will be manually dispatched from branch named - # `dapp-development`, workflow will deploy the contracts on the selected - # testnet and publish them to NPM registry with `dapp-dev-` - # suffix and `dapp-development-` tag. Such packages are meant - # to be used locally by the team developing Threshold Token dApp and may - # contain contracts that have different values from the ones used on - # mainnet. - # 2. If a workflow will be manually dispatched from a branch which name is not - # `dapp-development`, the workflow will deploy the contracts on the - # selected testnet and publish them to NPM registry with `` - # suffix and tag. Such packages will be used later to deploy public - # Threshold Token dApp on a testnet, with contracts resembling those used - # on mainnet. - workflow_dispatch: - inputs: - environment: - description: "Environment (network) for workflow execution, e.g. `sepolia`" - required: true - upstream_builds: - description: "Upstream builds" - required: false - upstream_ref: - description: "Git reference to checkout (e.g. branch name)" - required: false - default: "main" - -jobs: - contracts-detect-changes: - runs-on: ubuntu-latest - outputs: - path-filter: ${{ steps.set-output.outputs.path-filter }} - steps: - - name: Set path-filter output - id: set-output - run: echo "path-filter=true" >> $GITHUB_OUTPUT - - contracts-lint: - needs: contracts-detect-changes - runs-on: ubuntu-latest - defaults: - run: - working-directory: ./solidity/ecdsa - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-node@v3 - with: - # Using fixed version, because 18.16 was sometimes causing issues with - # artifacts generation during `hardhat compile` - see - # https://github.com/NomicFoundation/hardhat/issues/3877 - node-version: "18.15.0" - cache: "yarn" - cache-dependency-path: solidity/ecdsa/yarn.lock - - - name: Install dependencies - run: yarn install - - - name: Build - run: yarn build - - - name: Lint - run: yarn lint - - contracts-slither: - needs: contracts-detect-changes - runs-on: ubuntu-latest - defaults: - run: - working-directory: ./solidity/ecdsa - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-node@v3 - with: - # Using fixed version, because 18.16 was sometimes causing issues with - # artifacts generation during `hardhat compile` - see - # https://github.com/NomicFoundation/hardhat/issues/3877 - node-version: "18.15.0" - cache: "yarn" - cache-dependency-path: solidity/ecdsa/yarn.lock - - - uses: actions/setup-python@v4 - with: - python-version: 3.10.8 - - - 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.3 - run: pip3 install slither-analyzer==$SLITHER_VERSION - - - name: Install dependencies - run: yarn install - - # As a workaround for a slither issue https://github.com/crytic/slither/issues/1140 - # we disable compilation of dependencies when running slither. - - name: Run Slither - run: SKIP_DEPENDENCY_COMPILER=true slither . - - contracts-build-and-test: - needs: contracts-detect-changes - runs-on: ubuntu-latest - defaults: - run: - working-directory: ./solidity/ecdsa - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-node@v3 - with: - # Using fixed version, because 18.16 was sometimes causing issues with - # artifacts generation during `hardhat compile` - see - # https://github.com/NomicFoundation/hardhat/issues/3877 - node-version: "18.15.0" - cache: "yarn" - cache-dependency-path: solidity/ecdsa/yarn.lock - - - name: Install dependencies - run: yarn install - - - name: Build solidity contracts - run: yarn build - - - name: Run tests - if: github.ref != 'refs/heads/dapp-development' - run: yarn test - - contracts-deployment-dry-run: - needs: contracts-detect-changes - runs-on: ubuntu-latest - defaults: - run: - working-directory: ./solidity/ecdsa - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-node@v3 - with: - # Using fixed version, because 18.16 was sometimes causing issues with - # artifacts generation during `hardhat compile` - see - # https://github.com/NomicFoundation/hardhat/issues/3877 - node-version: "18.15.0" - cache: "yarn" - cache-dependency-path: solidity/ecdsa/yarn.lock - - - name: Install dependencies - run: yarn install --frozen-lockfile - - - name: Deploy contracts - run: yarn deploy:test - - - name: Build Docker Image - uses: ./.github/actions/docker-build-push - with: - imageName: keep-ecdsa-hardhat - push: false - context: ./solidity/ecdsa - - contracts-deployment-testnet: - needs: [contracts-build-and-test] - if: | - github.event_name == 'workflow_dispatch' - && github.ref != 'refs/heads/dapp-development' - runs-on: ubuntu-latest - defaults: - run: - working-directory: ./solidity/ecdsa - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-node@v3 - with: - # Using fixed version, because 18.16 was sometimes causing issues with - # artifacts generation during `hardhat compile` - see - # https://github.com/NomicFoundation/hardhat/issues/3877 - node-version: "18.15.0" - cache: "yarn" - cache-dependency-path: solidity/ecdsa/yarn.lock - registry-url: "https://registry.npmjs.org" - - - name: Install dependencies - run: yarn install --frozen-lockfile - - - name: Get upstream packages versions - uses: keep-network/ci/actions/upstream-builds-query@v2 - id: upstream-builds-query - with: - upstream-builds: ${{ github.event.inputs.upstream_builds }} - query: | - threshold-contracts-version = github.com/threshold-network/solidity-contracts#version - random-beacon-version = github.com/keep-network/keep-core/random-beacon#version - - - name: Resolve latest contracts - run: | - yarn upgrade \ - @threshold-network/solidity-contracts@${{ steps.upstream-builds-query.outputs.threshold-contracts-version }} \ - @keep-network/random-beacon@${{ steps.upstream-builds-query.outputs.random-beacon-version }} \ - @keep-network/sortition-pools - - # TODO: Remove this step. We replace sortition pools for deployment on testnet - # with forked contracts that were tweaked to make operators joining the pool - # easier. This should never be used outside of the test environment. On - # test environment it should be used temporarily only. - - name: Use Sortition Pool forked contracts - run: | - yarn upgrade @keep-network/sortition-pools@github:keep-network/sortition-pools#test-fork - - - name: Configure tenderly - env: - TENDERLY_TOKEN: ${{ secrets.TENDERLY_TOKEN }} - run: ./config_tenderly.sh - - - name: Deploy contracts - env: - CHAIN_API_URL: ${{ secrets.SEPOLIA_ETH_HOSTNAME_HTTP }} - ACCOUNTS_PRIVATE_KEYS: ${{ secrets.TESTNET_ETH_CONTRACT_OWNER_PRIVATE_KEY }} - ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }} - run: yarn deploy --network ${{ github.event.inputs.environment }} - - - name: Bump up package version - id: npm-version-bump - uses: keep-network/npm-version-bump@v2 - with: - work-dir: solidity/ecdsa - environment: ${{ github.event.inputs.environment }} - branch: ${{ github.ref }} - commit: ${{ github.sha }} - - - name: Publish to npm - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: npm publish --access=public --tag ${{ github.event.inputs.environment }} --network=${{ github.event.inputs.environment }} - - - name: Build and Publish Docker image - uses: ./.github/actions/docker-build-push - with: - environment: ${{ github.event.inputs.environment }} - imageName: keep-ecdsa-hardhat - context: ./solidity/ecdsa - push: true - gcrJsonKey: ${{ secrets.KEEP_TEST_GCR_JSON_KEY }} - - - name: Notify CI about completion of the workflow - uses: keep-network/ci/actions/notify-workflow-completed@v2 - env: - GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }} - with: - module: "github.com/keep-network/keep-core/ecdsa" - 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 }} - - # This job is responsible for publishing packackes with slightly modified - # contracts. The modifications are there to help with the process of testing - # some features on the T Token Dashboard. The job starts only if workflow - # gets triggered by the `workflow_dispatch` event on the branch called - # `dapp-development`. - contracts-dapp-development-deployment-testnet: - needs: [contracts-build-and-test] - if: | - github.event_name == 'workflow_dispatch' - && github.ref == 'refs/heads/dapp-development' - runs-on: ubuntu-latest - defaults: - run: - working-directory: ./solidity/ecdsa - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-node@v3 - with: - # Using fixed version, because 18.16 was sometimes causing issues with - # artifacts generation during `hardhat compile` - see - # https://github.com/NomicFoundation/hardhat/issues/3877 - node-version: "18.15.0" - cache: "yarn" - cache-dependency-path: solidity/ecdsa/yarn.lock - registry-url: "https://registry.npmjs.org" - - - name: Install dependencies - run: yarn install --frozen-lockfile - - - name: Get upstream packages versions - uses: keep-network/ci/actions/upstream-builds-query@v2 - id: upstream-builds-query - with: - upstream-builds: ${{ github.event.inputs.upstream_builds }} - query: | - threshold-contracts-version = github.com/threshold-network/solidity-contracts#version - random-beacon-version = github.com/keep-network/keep-core/random-beacon#version - - - name: Resolve latest contracts - run: | - yarn upgrade \ - @threshold-network/solidity-contracts@${{ steps.upstream-builds-query.outputs.threshold-contracts-version }} \ - @keep-network/random-beacon@${{ steps.upstream-builds-query.outputs.random-beacon-version }} \ - @keep-network/sortition-pools - - - name: Deploy contracts - env: - CHAIN_API_URL: ${{ secrets.SEPOLIA_ETH_HOSTNAME_HTTP }} - ACCOUNTS_PRIVATE_KEYS: ${{ secrets.DAPP_DEV_TESTNET_ETH_CONTRACT_OWNER_PRIVATE_KEY }} - ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }} - run: yarn deploy --network ${{ github.event.inputs.environment }} - - - name: Bump up package version - id: npm-version-bump - uses: keep-network/npm-version-bump@v2 - with: - work-dir: solidity/ecdsa - environment: dapp-dev-${{ github.event.inputs.environment }} - branch: ${{ github.ref }} - commit: ${{ github.sha }} - - - name: Publish to npm - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: npm publish --access=public --tag dapp-development-${{ github.event.inputs.environment }} --network=${{ github.event.inputs.environment }} - - - name: Build and Publish Docker image - uses: ./.github/actions/docker-build-push - with: - environment: ${{ github.event.inputs.environment }} - imageName: keep-ecdsa-hardhat-dapp-dev - context: ./solidity/ecdsa - push: true - gcrJsonKey: ${{ secrets.KEEP_TEST_GCR_JSON_KEY }} - - - name: Notify CI about completion of the workflow - uses: keep-network/ci/actions/notify-workflow-completed@v2 - env: - GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }} - with: - module: "github.com/keep-network/keep-core/ecdsa" - 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: dapp-development - version: ${{ steps.npm-version-bump.outputs.version }} diff --git a/.github/workflows/contracts-random-beacon.yml b/.github/workflows/contracts-random-beacon.yml deleted file mode 100644 index 71460b2456..0000000000 --- a/.github/workflows/contracts-random-beacon.yml +++ /dev/null @@ -1,346 +0,0 @@ -name: Solidity Random Beacon - -on: - # We intend to use `workflow dispatch` in two different situations/paths: - # 1. If a workflow will be manually dispatched from branch named - # `dapp-development`, workflow will deploy the contracts on the selected - # testnet and publish them to NPM registry with `dapp-dev-` - # suffix and `dapp-development-` tag. Such packages are meant - # to be used locally by the team developing Threshold Token dApp and may - # contain contracts that have different values from the ones used on - # mainnet. - # 2. If a workflow will be manually dispatched from a branch which name is not - # `dapp-development`, the workflow will deploy the contracts on the - # selected testnet and publish them to NPM registry with `` - # suffix and tag. Such packages will be used later to deploy public - # Threshold Token dApp on a testnet, with contracts resembling those used - # on mainnet. - workflow_dispatch: - inputs: - environment: - description: "Environment (network) for workflow execution, e.g. `sepolia`" - required: true - upstream_builds: - description: "Upstream builds" - required: false - upstream_ref: - description: "Git reference to checkout (e.g. branch name)" - required: false - default: "main" - -jobs: - contracts-detect-changes: - runs-on: ubuntu-latest - outputs: - path-filter: ${{ steps.set-output.outputs.path-filter }} - steps: - - name: Set path-filter output - id: set-output - run: echo "path-filter=true" >> $GITHUB_OUTPUT - - contracts-lint: - needs: contracts-detect-changes - runs-on: ubuntu-latest - defaults: - run: - working-directory: ./solidity/random-beacon - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-node@v3 - with: - # Using fixed version, because 18.16 was sometimes causing issues with - # artifacts generation during `hardhat compile` - see - # https://github.com/NomicFoundation/hardhat/issues/3877 - node-version: "18.15.0" - cache: "yarn" - cache-dependency-path: solidity/random-beacon/yarn.lock - - - name: Install dependencies - run: yarn install --network-concurrency 1 - - - name: Build - run: yarn build - - - name: Lint - run: yarn lint - - contracts-slither: - needs: contracts-detect-changes - runs-on: ubuntu-latest - defaults: - run: - working-directory: ./solidity/random-beacon - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-node@v3 - with: - # Using fixed version, because 18.16 was sometimes causing issues with - # artifacts generation during `hardhat compile` - see - # https://github.com/NomicFoundation/hardhat/issues/3877 - node-version: "18.15.0" - cache: "yarn" - cache-dependency-path: solidity/random-beacon/yarn.lock - - - uses: actions/setup-python@v4 - with: - python-version: 3.10.8 - - - name: Install Solidity - env: - SOLC_VERSION: 0.8.9 # according to solidity.version in hardhat.config.js - run: | - pip3 install solc-select - solc-select install $SOLC_VERSION - solc-select use $SOLC_VERSION - - - name: Install Slither - env: - SLITHER_VERSION: 0.8.3 - run: pip3 install slither-analyzer==$SLITHER_VERSION - - - name: Install dependencies - run: yarn install --network-concurrency 1 - - - name: Run Slither - run: slither . - - contracts-build-and-test: - needs: contracts-detect-changes - runs-on: ubuntu-latest - defaults: - run: - working-directory: ./solidity/random-beacon - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-node@v3 - with: - # Using fixed version, because 18.16 was sometimes causing issues with - # artifacts generation during `hardhat compile` - see - # https://github.com/NomicFoundation/hardhat/issues/3877 - node-version: "18.15.0" - cache: "yarn" - cache-dependency-path: solidity/random-beacon/yarn.lock - - - name: Install dependencies - run: yarn install --network-concurrency 1 - - - name: Build solidity contracts - run: yarn build - - - name: Run tests - if: github.ref != 'refs/heads/dapp-development' - run: yarn test - - contracts-deployment-dry-run: - needs: contracts-detect-changes - runs-on: ubuntu-latest - defaults: - run: - working-directory: ./solidity/random-beacon - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-node@v3 - with: - # Using fixed version, because 18.16 was sometimes causing issues with - # artifacts generation during `hardhat compile` - see - # https://github.com/NomicFoundation/hardhat/issues/3877 - node-version: "18.15.0" - cache: "yarn" - cache-dependency-path: solidity/random-beacon/yarn.lock - - - name: Install dependencies - run: yarn install --network-concurrency 1 --frozen-lockfile - - - name: Deploy contracts - run: yarn deploy:test - - - name: Build Docker Image - uses: ./.github/actions/docker-build-push - with: - imageName: keep-random-beacon-hardhat - context: ./solidity/random-beacon - push: false - - contracts-deployment-testnet: - needs: [contracts-build-and-test] - if: | - github.event_name == 'workflow_dispatch' - && github.ref != 'refs/heads/dapp-development' - runs-on: ubuntu-latest - defaults: - run: - working-directory: ./solidity/random-beacon - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-node@v3 - with: - # Using fixed version, because 18.16 was sometimes causing issues with - # artifacts generation during `hardhat compile` - see - # https://github.com/NomicFoundation/hardhat/issues/3877 - node-version: "18.15.0" - cache: "yarn" - cache-dependency-path: solidity/random-beacon/yarn.lock - registry-url: "https://registry.npmjs.org" - - - name: Install dependencies - run: yarn install --network-concurrency 1 --frozen-lockfile - - - name: Get upstream packages versions - uses: keep-network/ci/actions/upstream-builds-query@v2 - id: upstream-builds-query - with: - upstream-builds: ${{ github.event.inputs.upstream_builds }} - query: | - threshold-contracts-version = github.com/threshold-network/solidity-contracts#version - - - name: Resolve latest contracts - run: | - yarn upgrade \ - @threshold-network/solidity-contracts@${{ steps.upstream-builds-query.outputs.threshold-contracts-version }} \ - @keep-network/sortition-pools - - # TODO: Remove this step. We replace sortition pools for deployment on testnet - # with forked contracts that were tweaked to make operators joining the pool - # easier. This should never be used outside of the test environment. On - # test environment it should be used temporarily only. - - name: Use Sortition Pool forked contracts - run: | - yarn upgrade @keep-network/sortition-pools@github:keep-network/sortition-pools#test-fork - - - name: Configure tenderly - env: - TENDERLY_TOKEN: ${{ secrets.TENDERLY_TOKEN }} - run: ./config_tenderly.sh - - - name: Deploy contracts - env: - CHAIN_API_URL: ${{ secrets.SEPOLIA_ETH_HOSTNAME_HTTP }} - ACCOUNTS_PRIVATE_KEYS: ${{ secrets.TESTNET_ETH_CONTRACT_OWNER_PRIVATE_KEY }} - ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }} - run: yarn deploy --network ${{ github.event.inputs.environment }} - - - name: Bump up package version - id: npm-version-bump - uses: keep-network/npm-version-bump@v2 - with: - work-dir: solidity/random-beacon - environment: ${{ github.event.inputs.environment }} - branch: ${{ github.ref }} - commit: ${{ github.sha }} - - - name: Publish to npm - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: npm publish --access=public --tag ${{ github.event.inputs.environment }} --network=${{ github.event.inputs.environment }} - - - name: Build and Publish Docker image - uses: ./.github/actions/docker-build-push - with: - environment: ${{ github.event.inputs.environment }} - imageName: keep-random-beacon-hardhat - context: ./solidity/random-beacon - push: true - gcrJsonKey: ${{ secrets.KEEP_TEST_GCR_JSON_KEY }} - - - name: Notify CI about completion of the workflow - uses: keep-network/ci/actions/notify-workflow-completed@v2 - env: - GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }} - with: - module: "github.com/keep-network/keep-core/random-beacon" - 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 }} - - # This job is responsible for publishing packackes with slightly modified - # contracts. The modifications are there to help with the process of testing - # some features on the T Token Dashboard. The job starts only if workflow - # gets triggered by the `workflow_dispatch` event on the branch called - # `dapp-development`. - contracts-dapp-development-deployment-testnet: - needs: [contracts-build-and-test] - if: | - github.event_name == 'workflow_dispatch' - && github.ref == 'refs/heads/dapp-development' - runs-on: ubuntu-latest - defaults: - run: - working-directory: ./solidity/random-beacon - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-node@v3 - with: - # Using fixed version, because 18.16 was sometimes causing issues with - # artifacts generation during `hardhat compile` - see - # https://github.com/NomicFoundation/hardhat/issues/3877 - node-version: "18.15.0" - cache: "yarn" - cache-dependency-path: solidity/random-beacon/yarn.lock - registry-url: "https://registry.npmjs.org" - - - name: Install dependencies - run: yarn install --network-concurrency 1 --frozen-lockfile - - - name: Get upstream packages versions - uses: keep-network/ci/actions/upstream-builds-query@v2 - id: upstream-builds-query - with: - upstream-builds: ${{ github.event.inputs.upstream_builds }} - query: | - threshold-contracts-version = github.com/threshold-network/solidity-contracts#version - - - name: Resolve latest contracts - run: | - yarn upgrade \ - @threshold-network/solidity-contracts@${{ steps.upstream-builds-query.outputs.threshold-contracts-version }} \ - @keep-network/sortition-pools - - - name: Deploy contracts - env: - CHAIN_API_URL: ${{ secrets.SEPOLIA_ETH_HOSTNAME_HTTP }} - ACCOUNTS_PRIVATE_KEYS: ${{ secrets.DAPP_DEV_TESTNET_ETH_CONTRACT_OWNER_PRIVATE_KEY }} - ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }} - run: yarn deploy --network ${{ github.event.inputs.environment }} - - - name: Bump up package version - id: npm-version-bump - uses: keep-network/npm-version-bump@v2 - with: - work-dir: solidity/random-beacon - environment: dapp-dev-${{ github.event.inputs.environment }} - branch: ${{ github.ref }} - commit: ${{ github.sha }} - - - name: Publish to npm - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: npm publish --access=public --tag dapp-development-${{ github.event.inputs.environment }} --network=${{ github.event.inputs.environment }} - - - name: Build and Publish Docker image - uses: ./.github/actions/docker-build-push - with: - environment: ${{ github.event.inputs.environment }} - imageName: keep-random-beacon-hardhat-dapp-dev - context: ./solidity/random-beacon - push: true - gcrJsonKey: ${{ secrets.KEEP_TEST_GCR_JSON_KEY }} - - - name: Notify CI about completion of the workflow - uses: keep-network/ci/actions/notify-workflow-completed@v2 - env: - GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }} - with: - module: "github.com/keep-network/keep-core/random-beacon" - 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: dapp-development - version: ${{ steps.npm-version-bump.outputs.version }} From 92693bbfff11883ccff2733d9f410cc7dfe52796 Mon Sep 17 00:00:00 2001 From: Lev Akhnazarov Date: Fri, 12 Dec 2025 14:30:27 +0000 Subject: [PATCH 2/7] flow back --- .github/workflows/contracts-ecdsa.yml | 352 ++++++++++++++++++ .github/workflows/contracts-random-beacon.yml | 346 +++++++++++++++++ 2 files changed, 698 insertions(+) create mode 100644 .github/workflows/contracts-ecdsa.yml create mode 100644 .github/workflows/contracts-random-beacon.yml diff --git a/.github/workflows/contracts-ecdsa.yml b/.github/workflows/contracts-ecdsa.yml new file mode 100644 index 0000000000..7ec449b67c --- /dev/null +++ b/.github/workflows/contracts-ecdsa.yml @@ -0,0 +1,352 @@ +name: Solidity ECDSA + +on: + # We intend to use `workflow dispatch` in two different situations/paths: + # 1. If a workflow will be manually dispatched from branch named + # `dapp-development`, workflow will deploy the contracts on the selected + # testnet and publish them to NPM registry with `dapp-dev-` + # suffix and `dapp-development-` tag. Such packages are meant + # to be used locally by the team developing Threshold Token dApp and may + # contain contracts that have different values from the ones used on + # mainnet. + # 2. If a workflow will be manually dispatched from a branch which name is not + # `dapp-development`, the workflow will deploy the contracts on the + # selected testnet and publish them to NPM registry with `` + # suffix and tag. Such packages will be used later to deploy public + # Threshold Token dApp on a testnet, with contracts resembling those used + # on mainnet. + workflow_dispatch: + inputs: + environment: + description: "Environment (network) for workflow execution, e.g. `sepolia`" + required: true + upstream_builds: + description: "Upstream builds" + required: false + upstream_ref: + description: "Git reference to checkout (e.g. branch name)" + required: false + default: "main" + +jobs: + contracts-detect-changes: + runs-on: ubuntu-latest + outputs: + path-filter: ${{ steps.set-output.outputs.path-filter }} + steps: + - name: Set path-filter output + id: set-output + run: echo "path-filter=true" >> $GITHUB_OUTPUT + + contracts-lint: + needs: contracts-detect-changes + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./solidity/ecdsa + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-node@v3 + with: + # Using fixed version, because 18.16 was sometimes causing issues with + # artifacts generation during `hardhat compile` - see + # https://github.com/NomicFoundation/hardhat/issues/3877 + node-version: "18.15.0" + cache: "yarn" + cache-dependency-path: solidity/ecdsa/yarn.lock + + - name: Install dependencies + run: yarn install + + - name: Build + run: yarn build + + - name: Lint + run: yarn lint + + contracts-slither: + needs: contracts-detect-changes + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./solidity/ecdsa + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-node@v3 + with: + # Using fixed version, because 18.16 was sometimes causing issues with + # artifacts generation during `hardhat compile` - see + # https://github.com/NomicFoundation/hardhat/issues/3877 + node-version: "18.15.0" + cache: "yarn" + cache-dependency-path: solidity/ecdsa/yarn.lock + + - uses: actions/setup-python@v4 + with: + python-version: 3.10.8 + + - 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.3 + run: pip3 install slither-analyzer==$SLITHER_VERSION + + - name: Install dependencies + run: yarn install + + # As a workaround for a slither issue https://github.com/crytic/slither/issues/1140 + # we disable compilation of dependencies when running slither. + - name: Run Slither + run: SKIP_DEPENDENCY_COMPILER=true slither . + + contracts-build-and-test: + needs: contracts-detect-changes + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./solidity/ecdsa + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-node@v3 + with: + # Using fixed version, because 18.16 was sometimes causing issues with + # artifacts generation during `hardhat compile` - see + # https://github.com/NomicFoundation/hardhat/issues/3877 + node-version: "18.15.0" + cache: "yarn" + cache-dependency-path: solidity/ecdsa/yarn.lock + + - name: Install dependencies + run: yarn install + + - name: Build solidity contracts + run: yarn build + + - name: Run tests + if: github.ref != 'refs/heads/dapp-development' + run: yarn test + + contracts-deployment-dry-run: + needs: contracts-detect-changes + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./solidity/ecdsa + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-node@v3 + with: + # Using fixed version, because 18.16 was sometimes causing issues with + # artifacts generation during `hardhat compile` - see + # https://github.com/NomicFoundation/hardhat/issues/3877 + node-version: "18.15.0" + cache: "yarn" + cache-dependency-path: solidity/ecdsa/yarn.lock + + - name: Install dependencies + run: yarn install --frozen-lockfile + + - name: Deploy contracts + run: yarn deploy:test + + - name: Build Docker Image + uses: ./.github/actions/docker-build-push + with: + imageName: keep-ecdsa-hardhat + push: false + context: ./solidity/ecdsa + + contracts-deployment-testnet: + needs: [contracts-build-and-test] + if: | + github.event_name == 'workflow_dispatch' + && github.ref != 'refs/heads/dapp-development' + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./solidity/ecdsa + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-node@v3 + with: + # Using fixed version, because 18.16 was sometimes causing issues with + # artifacts generation during `hardhat compile` - see + # https://github.com/NomicFoundation/hardhat/issues/3877 + node-version: "18.15.0" + cache: "yarn" + cache-dependency-path: solidity/ecdsa/yarn.lock + registry-url: "https://registry.npmjs.org" + + - name: Install dependencies + run: yarn install --frozen-lockfile + + - name: Get upstream packages versions + uses: keep-network/ci/actions/upstream-builds-query@v2 + id: upstream-builds-query + with: + upstream-builds: ${{ github.event.inputs.upstream_builds }} + query: | + threshold-contracts-version = github.com/threshold-network/solidity-contracts#version + random-beacon-version = github.com/keep-network/keep-core/random-beacon#version + + - name: Resolve latest contracts + run: | + yarn upgrade \ + @threshold-network/solidity-contracts@${{ steps.upstream-builds-query.outputs.threshold-contracts-version }} \ + @keep-network/random-beacon@${{ steps.upstream-builds-query.outputs.random-beacon-version }} \ + @keep-network/sortition-pools + + # TODO: Remove this step. We replace sortition pools for deployment on testnet + # with forked contracts that were tweaked to make operators joining the pool + # easier. This should never be used outside of the test environment. On + # test environment it should be used temporarily only. + - name: Use Sortition Pool forked contracts + run: | + yarn upgrade @keep-network/sortition-pools@github:keep-network/sortition-pools#test-fork + + - name: Configure tenderly + env: + TENDERLY_TOKEN: ${{ secrets.TENDERLY_TOKEN }} + run: ./config_tenderly.sh + + - name: Deploy contracts + env: + CHAIN_API_URL: ${{ secrets.SEPOLIA_ETH_HOSTNAME_HTTP }} + ACCOUNTS_PRIVATE_KEYS: ${{ secrets.TESTNET_ETH_CONTRACT_OWNER_PRIVATE_KEY }} + ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }} + run: yarn deploy --network ${{ github.event.inputs.environment }} + + - name: Bump up package version + id: npm-version-bump + uses: keep-network/npm-version-bump@v2 + with: + work-dir: solidity/ecdsa + environment: ${{ github.event.inputs.environment }} + branch: ${{ github.ref }} + commit: ${{ github.sha }} + + - name: Publish to npm + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + run: npm publish --access=public --tag ${{ github.event.inputs.environment }} --network=${{ github.event.inputs.environment }} + + - name: Build and Publish Docker image + uses: ./.github/actions/docker-build-push + with: + environment: ${{ github.event.inputs.environment }} + imageName: keep-ecdsa-hardhat + context: ./solidity/ecdsa + push: true + gcrJsonKey: ${{ secrets.KEEP_TEST_GCR_JSON_KEY }} + + - name: Notify CI about completion of the workflow + uses: keep-network/ci/actions/notify-workflow-completed@v2 + env: + GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }} + with: + module: "github.com/keep-network/keep-core/ecdsa" + 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 }} + + # This job is responsible for publishing packackes with slightly modified + # contracts. The modifications are there to help with the process of testing + # some features on the T Token Dashboard. The job starts only if workflow + # gets triggered by the `workflow_dispatch` event on the branch called + # `dapp-development`. + contracts-dapp-development-deployment-testnet: + needs: [contracts-build-and-test] + if: | + github.event_name == 'workflow_dispatch' + && github.ref == 'refs/heads/dapp-development' + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./solidity/ecdsa + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-node@v3 + with: + # Using fixed version, because 18.16 was sometimes causing issues with + # artifacts generation during `hardhat compile` - see + # https://github.com/NomicFoundation/hardhat/issues/3877 + node-version: "18.15.0" + cache: "yarn" + cache-dependency-path: solidity/ecdsa/yarn.lock + registry-url: "https://registry.npmjs.org" + + - name: Install dependencies + run: yarn install --frozen-lockfile + + - name: Get upstream packages versions + uses: keep-network/ci/actions/upstream-builds-query@v2 + id: upstream-builds-query + with: + upstream-builds: ${{ github.event.inputs.upstream_builds }} + query: | + threshold-contracts-version = github.com/threshold-network/solidity-contracts#version + random-beacon-version = github.com/keep-network/keep-core/random-beacon#version + + - name: Resolve latest contracts + run: | + yarn upgrade \ + @threshold-network/solidity-contracts@${{ steps.upstream-builds-query.outputs.threshold-contracts-version }} \ + @keep-network/random-beacon@${{ steps.upstream-builds-query.outputs.random-beacon-version }} \ + @keep-network/sortition-pools + + - name: Deploy contracts + env: + CHAIN_API_URL: ${{ secrets.SEPOLIA_ETH_HOSTNAME_HTTP }} + ACCOUNTS_PRIVATE_KEYS: ${{ secrets.DAPP_DEV_TESTNET_ETH_CONTRACT_OWNER_PRIVATE_KEY }} + ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }} + run: yarn deploy --network ${{ github.event.inputs.environment }} + + - name: Bump up package version + id: npm-version-bump + uses: keep-network/npm-version-bump@v2 + with: + work-dir: solidity/ecdsa + environment: dapp-dev-${{ github.event.inputs.environment }} + branch: ${{ github.ref }} + commit: ${{ github.sha }} + + - name: Publish to npm + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + run: npm publish --access=public --tag dapp-development-${{ github.event.inputs.environment }} --network=${{ github.event.inputs.environment }} + + - name: Build and Publish Docker image + uses: ./.github/actions/docker-build-push + with: + environment: ${{ github.event.inputs.environment }} + imageName: keep-ecdsa-hardhat-dapp-dev + context: ./solidity/ecdsa + push: true + gcrJsonKey: ${{ secrets.KEEP_TEST_GCR_JSON_KEY }} + + - name: Notify CI about completion of the workflow + uses: keep-network/ci/actions/notify-workflow-completed@v2 + env: + GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }} + with: + module: "github.com/keep-network/keep-core/ecdsa" + 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: dapp-development + version: ${{ steps.npm-version-bump.outputs.version }} diff --git a/.github/workflows/contracts-random-beacon.yml b/.github/workflows/contracts-random-beacon.yml new file mode 100644 index 0000000000..71460b2456 --- /dev/null +++ b/.github/workflows/contracts-random-beacon.yml @@ -0,0 +1,346 @@ +name: Solidity Random Beacon + +on: + # We intend to use `workflow dispatch` in two different situations/paths: + # 1. If a workflow will be manually dispatched from branch named + # `dapp-development`, workflow will deploy the contracts on the selected + # testnet and publish them to NPM registry with `dapp-dev-` + # suffix and `dapp-development-` tag. Such packages are meant + # to be used locally by the team developing Threshold Token dApp and may + # contain contracts that have different values from the ones used on + # mainnet. + # 2. If a workflow will be manually dispatched from a branch which name is not + # `dapp-development`, the workflow will deploy the contracts on the + # selected testnet and publish them to NPM registry with `` + # suffix and tag. Such packages will be used later to deploy public + # Threshold Token dApp on a testnet, with contracts resembling those used + # on mainnet. + workflow_dispatch: + inputs: + environment: + description: "Environment (network) for workflow execution, e.g. `sepolia`" + required: true + upstream_builds: + description: "Upstream builds" + required: false + upstream_ref: + description: "Git reference to checkout (e.g. branch name)" + required: false + default: "main" + +jobs: + contracts-detect-changes: + runs-on: ubuntu-latest + outputs: + path-filter: ${{ steps.set-output.outputs.path-filter }} + steps: + - name: Set path-filter output + id: set-output + run: echo "path-filter=true" >> $GITHUB_OUTPUT + + contracts-lint: + needs: contracts-detect-changes + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./solidity/random-beacon + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-node@v3 + with: + # Using fixed version, because 18.16 was sometimes causing issues with + # artifacts generation during `hardhat compile` - see + # https://github.com/NomicFoundation/hardhat/issues/3877 + node-version: "18.15.0" + cache: "yarn" + cache-dependency-path: solidity/random-beacon/yarn.lock + + - name: Install dependencies + run: yarn install --network-concurrency 1 + + - name: Build + run: yarn build + + - name: Lint + run: yarn lint + + contracts-slither: + needs: contracts-detect-changes + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./solidity/random-beacon + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-node@v3 + with: + # Using fixed version, because 18.16 was sometimes causing issues with + # artifacts generation during `hardhat compile` - see + # https://github.com/NomicFoundation/hardhat/issues/3877 + node-version: "18.15.0" + cache: "yarn" + cache-dependency-path: solidity/random-beacon/yarn.lock + + - uses: actions/setup-python@v4 + with: + python-version: 3.10.8 + + - name: Install Solidity + env: + SOLC_VERSION: 0.8.9 # according to solidity.version in hardhat.config.js + run: | + pip3 install solc-select + solc-select install $SOLC_VERSION + solc-select use $SOLC_VERSION + + - name: Install Slither + env: + SLITHER_VERSION: 0.8.3 + run: pip3 install slither-analyzer==$SLITHER_VERSION + + - name: Install dependencies + run: yarn install --network-concurrency 1 + + - name: Run Slither + run: slither . + + contracts-build-and-test: + needs: contracts-detect-changes + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./solidity/random-beacon + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-node@v3 + with: + # Using fixed version, because 18.16 was sometimes causing issues with + # artifacts generation during `hardhat compile` - see + # https://github.com/NomicFoundation/hardhat/issues/3877 + node-version: "18.15.0" + cache: "yarn" + cache-dependency-path: solidity/random-beacon/yarn.lock + + - name: Install dependencies + run: yarn install --network-concurrency 1 + + - name: Build solidity contracts + run: yarn build + + - name: Run tests + if: github.ref != 'refs/heads/dapp-development' + run: yarn test + + contracts-deployment-dry-run: + needs: contracts-detect-changes + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./solidity/random-beacon + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-node@v3 + with: + # Using fixed version, because 18.16 was sometimes causing issues with + # artifacts generation during `hardhat compile` - see + # https://github.com/NomicFoundation/hardhat/issues/3877 + node-version: "18.15.0" + cache: "yarn" + cache-dependency-path: solidity/random-beacon/yarn.lock + + - name: Install dependencies + run: yarn install --network-concurrency 1 --frozen-lockfile + + - name: Deploy contracts + run: yarn deploy:test + + - name: Build Docker Image + uses: ./.github/actions/docker-build-push + with: + imageName: keep-random-beacon-hardhat + context: ./solidity/random-beacon + push: false + + contracts-deployment-testnet: + needs: [contracts-build-and-test] + if: | + github.event_name == 'workflow_dispatch' + && github.ref != 'refs/heads/dapp-development' + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./solidity/random-beacon + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-node@v3 + with: + # Using fixed version, because 18.16 was sometimes causing issues with + # artifacts generation during `hardhat compile` - see + # https://github.com/NomicFoundation/hardhat/issues/3877 + node-version: "18.15.0" + cache: "yarn" + cache-dependency-path: solidity/random-beacon/yarn.lock + registry-url: "https://registry.npmjs.org" + + - name: Install dependencies + run: yarn install --network-concurrency 1 --frozen-lockfile + + - name: Get upstream packages versions + uses: keep-network/ci/actions/upstream-builds-query@v2 + id: upstream-builds-query + with: + upstream-builds: ${{ github.event.inputs.upstream_builds }} + query: | + threshold-contracts-version = github.com/threshold-network/solidity-contracts#version + + - name: Resolve latest contracts + run: | + yarn upgrade \ + @threshold-network/solidity-contracts@${{ steps.upstream-builds-query.outputs.threshold-contracts-version }} \ + @keep-network/sortition-pools + + # TODO: Remove this step. We replace sortition pools for deployment on testnet + # with forked contracts that were tweaked to make operators joining the pool + # easier. This should never be used outside of the test environment. On + # test environment it should be used temporarily only. + - name: Use Sortition Pool forked contracts + run: | + yarn upgrade @keep-network/sortition-pools@github:keep-network/sortition-pools#test-fork + + - name: Configure tenderly + env: + TENDERLY_TOKEN: ${{ secrets.TENDERLY_TOKEN }} + run: ./config_tenderly.sh + + - name: Deploy contracts + env: + CHAIN_API_URL: ${{ secrets.SEPOLIA_ETH_HOSTNAME_HTTP }} + ACCOUNTS_PRIVATE_KEYS: ${{ secrets.TESTNET_ETH_CONTRACT_OWNER_PRIVATE_KEY }} + ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }} + run: yarn deploy --network ${{ github.event.inputs.environment }} + + - name: Bump up package version + id: npm-version-bump + uses: keep-network/npm-version-bump@v2 + with: + work-dir: solidity/random-beacon + environment: ${{ github.event.inputs.environment }} + branch: ${{ github.ref }} + commit: ${{ github.sha }} + + - name: Publish to npm + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + run: npm publish --access=public --tag ${{ github.event.inputs.environment }} --network=${{ github.event.inputs.environment }} + + - name: Build and Publish Docker image + uses: ./.github/actions/docker-build-push + with: + environment: ${{ github.event.inputs.environment }} + imageName: keep-random-beacon-hardhat + context: ./solidity/random-beacon + push: true + gcrJsonKey: ${{ secrets.KEEP_TEST_GCR_JSON_KEY }} + + - name: Notify CI about completion of the workflow + uses: keep-network/ci/actions/notify-workflow-completed@v2 + env: + GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }} + with: + module: "github.com/keep-network/keep-core/random-beacon" + 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 }} + + # This job is responsible for publishing packackes with slightly modified + # contracts. The modifications are there to help with the process of testing + # some features on the T Token Dashboard. The job starts only if workflow + # gets triggered by the `workflow_dispatch` event on the branch called + # `dapp-development`. + contracts-dapp-development-deployment-testnet: + needs: [contracts-build-and-test] + if: | + github.event_name == 'workflow_dispatch' + && github.ref == 'refs/heads/dapp-development' + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./solidity/random-beacon + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-node@v3 + with: + # Using fixed version, because 18.16 was sometimes causing issues with + # artifacts generation during `hardhat compile` - see + # https://github.com/NomicFoundation/hardhat/issues/3877 + node-version: "18.15.0" + cache: "yarn" + cache-dependency-path: solidity/random-beacon/yarn.lock + registry-url: "https://registry.npmjs.org" + + - name: Install dependencies + run: yarn install --network-concurrency 1 --frozen-lockfile + + - name: Get upstream packages versions + uses: keep-network/ci/actions/upstream-builds-query@v2 + id: upstream-builds-query + with: + upstream-builds: ${{ github.event.inputs.upstream_builds }} + query: | + threshold-contracts-version = github.com/threshold-network/solidity-contracts#version + + - name: Resolve latest contracts + run: | + yarn upgrade \ + @threshold-network/solidity-contracts@${{ steps.upstream-builds-query.outputs.threshold-contracts-version }} \ + @keep-network/sortition-pools + + - name: Deploy contracts + env: + CHAIN_API_URL: ${{ secrets.SEPOLIA_ETH_HOSTNAME_HTTP }} + ACCOUNTS_PRIVATE_KEYS: ${{ secrets.DAPP_DEV_TESTNET_ETH_CONTRACT_OWNER_PRIVATE_KEY }} + ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }} + run: yarn deploy --network ${{ github.event.inputs.environment }} + + - name: Bump up package version + id: npm-version-bump + uses: keep-network/npm-version-bump@v2 + with: + work-dir: solidity/random-beacon + environment: dapp-dev-${{ github.event.inputs.environment }} + branch: ${{ github.ref }} + commit: ${{ github.sha }} + + - name: Publish to npm + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + run: npm publish --access=public --tag dapp-development-${{ github.event.inputs.environment }} --network=${{ github.event.inputs.environment }} + + - name: Build and Publish Docker image + uses: ./.github/actions/docker-build-push + with: + environment: ${{ github.event.inputs.environment }} + imageName: keep-random-beacon-hardhat-dapp-dev + context: ./solidity/random-beacon + push: true + gcrJsonKey: ${{ secrets.KEEP_TEST_GCR_JSON_KEY }} + + - name: Notify CI about completion of the workflow + uses: keep-network/ci/actions/notify-workflow-completed@v2 + env: + GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }} + with: + module: "github.com/keep-network/keep-core/random-beacon" + 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: dapp-development + version: ${{ steps.npm-version-bump.outputs.version }} From 7fb3e0a16e8381058512ec3ece50f641eafd1d97 Mon Sep 17 00:00:00 2001 From: Lev Akhnazarov Date: Fri, 12 Dec 2025 14:39:46 +0000 Subject: [PATCH 3/7] run on pr --- .github/workflows/contracts-ecdsa.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/contracts-ecdsa.yml b/.github/workflows/contracts-ecdsa.yml index 7ec449b67c..2564db4c46 100644 --- a/.github/workflows/contracts-ecdsa.yml +++ b/.github/workflows/contracts-ecdsa.yml @@ -1,6 +1,10 @@ name: Solidity ECDSA on: + pull_request: + paths: + - "solidity/ecdsa/**" + - ".github/workflows/contracts-ecdsa.yml" # We intend to use `workflow dispatch` in two different situations/paths: # 1. If a workflow will be manually dispatched from branch named # `dapp-development`, workflow will deploy the contracts on the selected From e50cc206a24b6d9437d63161fb7483c6be855df9 Mon Sep 17 00:00:00 2001 From: lion <139767474+lionakhnazarov@users.noreply.github.com> Date: Fri, 12 Dec 2025 14:47:23 +0000 Subject: [PATCH 4/7] Update contracts-ecdsa.yml --- .github/workflows/contracts-ecdsa.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/contracts-ecdsa.yml b/.github/workflows/contracts-ecdsa.yml index 2564db4c46..a09f78b74c 100644 --- a/.github/workflows/contracts-ecdsa.yml +++ b/.github/workflows/contracts-ecdsa.yml @@ -2,9 +2,6 @@ name: Solidity ECDSA on: pull_request: - paths: - - "solidity/ecdsa/**" - - ".github/workflows/contracts-ecdsa.yml" # We intend to use `workflow dispatch` in two different situations/paths: # 1. If a workflow will be manually dispatched from branch named # `dapp-development`, workflow will deploy the contracts on the selected From bc75b651d7a0a39c82709dc43d5a09270556c2ec Mon Sep 17 00:00:00 2001 From: Lev Akhnazarov Date: Fri, 12 Dec 2025 15:21:38 +0000 Subject: [PATCH 5/7] revert workflow dispatch --- .github/workflows/contracts-ecdsa.yml | 3 +-- .github/workflows/contracts-random-beacon.yml | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/contracts-ecdsa.yml b/.github/workflows/contracts-ecdsa.yml index a09f78b74c..2f3efdfe8b 100644 --- a/.github/workflows/contracts-ecdsa.yml +++ b/.github/workflows/contracts-ecdsa.yml @@ -1,7 +1,6 @@ name: Solidity ECDSA on: - pull_request: # We intend to use `workflow dispatch` in two different situations/paths: # 1. If a workflow will be manually dispatched from branch named # `dapp-development`, workflow will deploy the contracts on the selected @@ -350,4 +349,4 @@ jobs: environment: ${{ github.event.inputs.environment }} upstream_builds: ${{ github.event.inputs.upstream_builds }} upstream_ref: dapp-development - version: ${{ steps.npm-version-bump.outputs.version }} + version: ${{ steps.npm-version-bump.outputs.version }} \ No newline at end of file diff --git a/.github/workflows/contracts-random-beacon.yml b/.github/workflows/contracts-random-beacon.yml index 71460b2456..6402472d77 100644 --- a/.github/workflows/contracts-random-beacon.yml +++ b/.github/workflows/contracts-random-beacon.yml @@ -343,4 +343,4 @@ jobs: environment: ${{ github.event.inputs.environment }} upstream_builds: ${{ github.event.inputs.upstream_builds }} upstream_ref: dapp-development - version: ${{ steps.npm-version-bump.outputs.version }} + version: ${{ steps.npm-version-bump.outputs.version }} \ No newline at end of file From b0ca51fb48f3c8e2d5bf319b0e8ba6a78901df4f Mon Sep 17 00:00:00 2001 From: Lev Akhnazarov Date: Fri, 12 Dec 2025 15:43:31 +0000 Subject: [PATCH 6/7] test --- solidity/ecdsa/contracts/WalletRegistry.sol | 2 ++ 1 file changed, 2 insertions(+) diff --git a/solidity/ecdsa/contracts/WalletRegistry.sol b/solidity/ecdsa/contracts/WalletRegistry.sol index b24f2eeccd..81d05a6b34 100644 --- a/solidity/ecdsa/contracts/WalletRegistry.sol +++ b/solidity/ecdsa/contracts/WalletRegistry.sol @@ -34,6 +34,8 @@ import "@threshold-network/solidity-contracts/contracts/staking/IStaking.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; +// TODO: Remove this once the contract is deployed to the mainnet + contract WalletRegistry is IWalletRegistry, IRandomBeaconConsumer, From c6424017da5c7b0fa2bbbd67c57c267d44b4b326 Mon Sep 17 00:00:00 2001 From: Lev Akhnazarov Date: Fri, 12 Dec 2025 16:44:15 +0000 Subject: [PATCH 7/7] release flow --- .github/workflows/release.yml | 59 +++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7813775382..7df458d649 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -114,3 +114,62 @@ jobs: run: | rm -rf /tmp/.buildx-cache mv /tmp/.buildx-cache-new /tmp/.buildx-cache + + publish-docker-images: + needs: build-and-release + runs-on: ubuntu-latest + environment: keep-production # Requires release-admin team approval + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Resolve versions + run: | + echo "version=$(git describe --tags --match 'v[0-9]*' HEAD)" >> $GITHUB_ENV + echo "revision=$(git rev-parse --short HEAD)" >> $GITHUB_ENV + echo "dockerhub_org=${DOCKERHUB_ORG:-thresholdnetwork}" >> $GITHUB_ENV + env: + DOCKERHUB_ORG: ${{ secrets.DOCKERHUB_ORG }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Cache Docker layers + uses: actions/cache@v4 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-docker-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx-docker- + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and Push Docker Images + uses: docker/build-push-action@v5 + with: + target: runtime-docker + tags: | + ${{ env.dockerhub_org }}/keep-client:latest + ${{ env.dockerhub_org }}/keep-client:${{ env.version }} + ${{ env.dockerhub_org }}/keep-client:mainnet + labels: | + version=${{ env.version }} + revision=${{ env.revision }} + build-args: | + ENVIRONMENT=mainnet + VERSION=${{ env.version }} + REVISION=${{ env.revision }} + push: true + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-docker-new + context: . + + - name: Move Docker cache + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-docker-new /tmp/.buildx-cache \ No newline at end of file