diff --git a/.github/workflows/Deploy.yml b/.github/workflows/Deploy.yml deleted file mode 100644 index dd8c1ea..0000000 --- a/.github/workflows/Deploy.yml +++ /dev/null @@ -1,105 +0,0 @@ -name: Full Deployment - -on: - workflow_dispatch: - -jobs: - Deploy-to-main: - runs-on: ubuntu-latest - - steps: - - name: Checkout sources - uses: actions/checkout@v3 - - name: Foundry PreSetup - uses: actions/checkout@v3 - env: - FOUNDRY_PROFILE: ci - with: - submodules: recursive - - name: Set up Python 3.8 - uses: actions/setup-python@v4 - with: - python-version: 3.8 - - name: Install stable toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: 1.63.0 - target: wasm32-unknown-unknown - override: true - - name: Install wasm-opt - run: sudo apt update && sudo apt install -y binaryen clang - - name: Build Secret gateway contract - run: cd TNLS-Gateways/secret/ && make build-mainnet - - name: Build Secret sample contract - run: cd TNLS-Gateways/secret/tests/example-private-contract && make build-mainnet - - name: Install dependencies - run: npm --prefix secret-deploy/ install - - name: Create .env file for Node - env: - MNEMONIC: ${{ secrets.SECRET_WALLET_MNEMONIC }} - run: | - touch secret-deploy/.env - echo MNEMONIC="$MNEMONIC" >> secret-deploy/.env - echo GRPC_WEB_URL='"https://grpc.testnet.secretsaturn.net"' >> secret-deploy/.env - echo CHAIN_ID='"pulsar-3"' >> secret-deploy/.env - cat secret-deploy/.env - - name: Deploy Secret contracts - working-directory: ./secret-deploy - run: npx ts-node deploy.ts - - name: Get Secret contract details - run: | - echo "SECRET_GATEWAY_CODE_HASH=$(sed -n '2{p;q}' secret-deploy/secret_gateway.log)" >> $GITHUB_ENV - echo "SECRET_GATEWAY_ADDRESS=$(sed -n '3{p;q}' secret-deploy/secret_gateway.log)" >> $GITHUB_ENV - echo "SECRET_GATEWAY_ETH_ADDRESS=$(sed -n '5{p;q}' secret-deploy/secret_gateway.log)" >> $GITHUB_ENV - echo "SECRET_SAMPLE_CODE_HASH=$(sed -n '2{p;q}' secret-deploy/secret_sample.log)" >> $GITHUB_ENV - echo "SECRET_SAMPLE_ADDRESS=$(sed -n '3{p;q}' secret-deploy/secret_sample.log)" >> $GITHUB_ENV - - name: Update config.yml with Secret info - run: | - sed -i 's;INSERT_SECRET_CONTRACT_ADDRESS_HERE;${{ env.SECRET_GATEWAY_ADDRESS }};g' config.yml - sed -i 's;INSERT_SECRET_CONTRACT_ETH_ADDRESS_HERE;${{ env.SECRET_GATEWAY_ETH_ADDRESS }};g' config.yml - cat config.yml - git config --global user.email "leor@atbash.co" - git config --global user.name "Leor Fishman" - git commit -am "Update config.yml with Secret info" - - name: Install jq - run: sudo apt update && sudo apt install -y jq - - name: Install Foundry - uses: foundry-rs/foundry-toolchain@v1 - with: - version: nightly - - name: Run Forge build - working-directory: ./public-gateway - run: | - forge --version - forge build --sizes - id: build - - name: Run Forge tests - working-directory: ./public-gateway - run: | - forge test -vvv - id: test - - name: Deploy Procedure - working-directory: ./public-gateway - env: - INFURA_API_URL: ${{secrets.INFURA_API_URL}} - ETH_PRIVATE_KEY: ${{secrets.ETH_PRIVATE_KEY}} - ETHERSCAN_KEY: ${{secrets.ETHERSCAN_KEY}} - SECRET_GATEWAY_ETH_ADDRESS: ${{env.SECRET_GATEWAY_ETH_ADDRESS}} - run: | - forge script script/DeployScript.s.sol:DeployScript --rpc-url "$INFURA_API_URL" --private-key "$ETH_PRIVATE_KEY" --etherscan-api-key "$ETHERSCAN_KEY" --broadcast --verify --retries 10 -vvvv - echo "ETH_GATEWAY_ADDRESS=$(jq -r '.transactions[1].contractAddress' /home/runner/work/TNLS/TNLS/public-gateway/broadcast/DeployScript.s.sol/5/run-latest.json)" >> $GITHUB_ENV - echo "ETH_CLIENT_ADDRESS=$(jq -r '.transactions[2].contractAddress' /home/runner/work/TNLS/TNLS/public-gateway/broadcast/DeployScript.s.sol/5/run-latest.json)" >> $GITHUB_ENV - - name: Update config.yml with Ethereum Contract info - run: | - sed -i 's;INSERT_ETHEREUM_CONTRACT_ADDRESS_HERE;${{ env.ETH_GATEWAY_ADDRESS }};g' config.yml - cat config.yml - git config --global user.email "leor@atbash.co" - git config --global user.name "Leor Fishman" - git commit -am "Update config.yml with Ethereum contract info" - - name: Deploy webserver to heroku - uses: akhileshns/heroku-deploy@v3.12.12 - with: - heroku_api_key: ${{ secrets.HEROKU_API_KEY }} - heroku_app_name: "atbash-demo-server" - heroku_email: ${{ secrets.HEROKU_EMAIL }} diff --git a/.github/workflows/EthDeploy.yml b/.github/workflows/EthDeploy.yml deleted file mode 100644 index e8090f1..0000000 --- a/.github/workflows/EthDeploy.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: Ethereum Deployment - -on: - workflow_dispatch: - -env: - FOUNDRY_PROFILE: ci - -jobs: - check: - strategy: - fail-fast: true - - name: Foundry project - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - submodules: recursive - - - name: Install Foundry - uses: foundry-rs/foundry-toolchain@v1 - with: - version: nightly - - - name: Run Forge build - working-directory: ./public-gateway - run: | - forge --version - forge build --sizes - id: build - - - name: Run Forge tests - working-directory: ./public-gateway - run: | - forge test -vvv - id: test - - - name: Deploy Procedure - working-directory: ./public-gateway - env: - ALCHEMY_ENDPOINT: ${{secrets.ALCHEMY_ENDPOINT}} - PRIVATE_KEY: ${{secrets.PRIVATE_KEY}} - ETHERSCAN_KEY: ${{secrets.ETHERSCAN_KEY}} - run: | - forge script script/DeployScript.s.sol:DeployScript --rpc-url "$ALCHEMY_ENDPOINT" --private-key "$PRIVATE_KEY" --etherscan-api-key "$ETHERSCAN_KEY" --broadcast --verify -vvvv diff --git a/.github/workflows/Relayer_tests.yml b/.github/workflows/Relayer_tests.yml deleted file mode 100644 index c64ba01..0000000 --- a/.github/workflows/Relayer_tests.yml +++ /dev/null @@ -1,72 +0,0 @@ -name: Relayer Tests - -on: - workflow_dispatch: - push: - branches: - - main - paths: - - "TNLS-Relayers/**" - - ".github/workflows/Relayer_tests.yml" - pull_request: - branches: - - main - paths: - - "TNLS-Relayers/**" - - ".github/workflows/Relayer_tests.yml" - -jobs: - build-and-test-python: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - name: Set up Python 3.8 - uses: actions/setup-python@v4 - with: - python-version: 3.8 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install pytest - pip install -r requirements.txt - - name: Write Config File - working-directory: ./TNLS-Relayers - env: - INFURA_ENDPOINT: ${{ secrets.INFURA_ENDPOINT }} - run: | - touch infura_api_endpoint.txt - echo "$INFURA_ENDPOINT" > infura_api_endpoint.txt - - name: Start LocalSecret - working-directory: ./TNLS-Relayers - run: | - docker pull ghcr.io/scrtlabs/localsecret:v1.13.3 - docker run -it -d -p 9091:9091 -p 26657:26657 -p 1317:1317 -p 5000:5000 --name localsecret ghcr.io/scrtlabs/localsecret:v1.12.1 - sleep 60 - - - name: Install secretcli - run: | - wget https://github.com/scrtlabs/SecretNetwork/releases/download/v1.13.3/secretcli-Linux - chmod +x secretcli-Linux - sudo mv secretcli-Linux /usr/local/bin/secretcli - - - name: Configure Secretcli to work with localSecret - working-directory: ./TNLS-Relayers/relayer_tests/interface_tests - run: | - chmod +x ./configure_secretcli.sh - ./configure_secretcli.sh - - name: Upload contract to localSecret - working-directory: ./TNLS-Relayers/relayer_tests/interface_tests/test_scrt_contract - run: | - chmod +x ./upload_scrt_contract.sh - SGX_MODE=SW ./upload_scrt_contract.sh - - - name: Test with pytest - working-directory: ./TNLS-Relayers - run: | - pytest - - name: Stop LocalSecret - working-directory: ./TNLS-Relayers - run: | - docker stop localsecret - docker rm localsecret