Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Polygon Deploy Script #2

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
47 changes: 47 additions & 0 deletions .github/workflows/deploy-goerli.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Deploy Sleuth [Goerli]

on:
pull_request:
workflow_dispatch:
inputs:
deployer_address:
description: WalletConnect address to deploy from
required: true

env:
FOUNDRY_PROFILE: ci

jobs:
check:
strategy:
fail-fast: true

name: Deploy Sleuth [Goerli]
runs-on: ubuntu-latest
steps:
- name: Start Seacrest
uses: hayesgm/seacrest@v1
with:
ethereum_url: "${{ secrets.ETH_GOERLI_URL }}"
requested_network: 5

- uses: actions/checkout@v3
with:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Run Forge build
run: |
forge --version
forge build --sizes

- name: Forge Deploy Sleuth [Goerli]
run: script/ethereum/deploy.sh
env:
GOERLI_API_KEY: "${{ secrets.GOERLI_API_KEY }}"
ETH_FROM: "${{ inputs.deployer_address }}"
RPC_URL: "http://localhost:8585"
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
forge build --sizes

- name: Forge Deploy Sleuth [Mainnet]
run: script/mainnet/deploy.sh
run: script/ethereum/deploy.sh
env:
ETHERSCAN_API_KEY: "${{ secrets.ETHERSCAN_API_KEY }}"
ETH_FROM: "${{ inputs.deployer_address }}"
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/deploy-polygon.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Deploy Sleuth [Polygon]

on:
pull_request:
workflow_dispatch:
inputs:
deployer_address:
description: WalletConnect address to deploy from
required: true

env:
FOUNDRY_PROFILE: ci

jobs:
check:
strategy:
fail-fast: true

name: Deploy Sleuth [Polygon]
runs-on: ubuntu-latest
steps:
- name: Start Seacrest
uses: hayesgm/seacrest@v1
with:
ethereum_url: "${{ secrets.ETH_POLYGON_URL }}"
requested_network: 137

- uses: actions/checkout@v3
with:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Run Forge build
run: |
forge --version
forge build --sizes

- name: Forge Deploy Sleuth [Polygon]
run: script/polygon/deploy.sh
env:
POLYGON_API_KEY: "${{ secrets.POLYGON_API_KEY }}"
ETH_FROM: "${{ inputs.deployer_address }}"
RPC_URL: "http://localhost:8585"
File renamed without changes.
29 changes: 29 additions & 0 deletions script/polygon/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

set -exo pipefail

if [ -n "$ETHEREUM_PK" ]; then
wallet_args="--private-key $ETHEREUM_PK"
else
wallet_args="--unlocked"
fi

if [ -n "$RPC_URL" ]; then
rpc_args="--rpc-url $RPC_URL"
else
rpc_args=""
fi

if [ -n "$POLYGON_API_KEY" ]; then
etherscan_args="--verify --etherscan-api-key $POLYGON_API_KEY"
else
etherscan_args=""
fi

forge create \
$rpc_args \
$etherscan_args \
$wallet_args \
$@ \
src/Sleuth.sol:Sleuth
s