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

feat: Create deployment script #15

Merged
merged 10 commits into from
May 23, 2024
Merged
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
70 changes: 70 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Deploy

on:
workflow_dispatch:
inputs:
network:
type: choice
description: Network
options:
- mainnet
- sepolia
- base
- base-sepolia
contract:
description: Contract to deploy
required: true

jobs:
deploy-contract:
name: Deploy Contract
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- uses: actions/setup-node@v2
with:
node-version: "16"

- name: Install packages
run: npm install

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

- name: Set RPC URL for mainnet
if: ${{ github.event.inputs.network == 'mainnet' }}
run: echo "RPC_URL=${{ secrets.MAINNET_RPC_URL }}" >> $GITHUB_ENV

- name: Set RPC URL for sepolia
if: ${{ github.event.inputs.network == 'sepolia' }}
run: echo "RPC_URL=${{ secrets.SEPOLIA_RPC_URL }}" >> $GITHUB_ENV

- name: Set RPC URL for base
if: ${{ github.event.inputs.network == 'base' }}
run: echo "RPC_URL=${{ secrets.BASE_RPC_URL }}" >> $GITHUB_ENV

- name: Set RPC URL for base-sepolia
if: ${{ github.event.inputs.network == 'base-sepolia' }}
run: echo "RPC_URL=${{ secrets.BASE_SEPOLIA_RPC_URL }}" >> $GITHUB_ENV

- name: Run Deploy
run: |
npx ts-node script/deploy.ts deploy ${{ github.event.inputs.contract }} --rpc ${{ env.RPC_URL }} --pk ${{ secrets.private_key }}
env:
NETWORK: ${{ github.event.inputs.network }}
CONTRACT: ${{ github.event.inputs.contract }}
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
RPC_URL: ${{ env.RPC_URL }}
BASESCAN_API_KEY: ${{ secrets.BASESCAN_API_KEY }}

- name: Prettier Fix
run: npm run prettier:write

- name: Commit and push changes
run: |
git config --global user.name 'GitHub Actions Bot'
git config --global user.email '<>'
git commit -a -m "CI deployment of ${{ github.event.inputs.contract }}"
git push
11 changes: 11 additions & 0 deletions deployments/8453.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"contracts": {
"Dropper": {
"deploys": [
{ "deployedArgs": "0x", "version": "1.0.0", "address": "0xf7dfc33c76f84a5c852f5366598e67cce91bad53" }
],
"constructorArgs": []
}
},
"constants": {}
}
13 changes: 8 additions & 5 deletions deployments/84532.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
{
"Dropper": [
{
"version": "1.0.0",
"address": "0x2871e49a08acee842c8f225be7bff9cc311b9f43"
"contracts": {
"Dropper": {
"deploys": [
{ "deployedArgs": "0x", "version": "1.0.0", "address": "0x680168736298451b945F1Dc5D952408C102E7De7" }
],
"constructorArgs": []
}
]
},
"constants": {}
}
8 changes: 8 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"url": "https://github.com/PartyDAO"
},
"devDependencies": {
"@types/node": "^20.12.10",
"@types/yargs": "^17.0.32",
"prettier": "^3.0.0",
"prettier-plugin-solidity": "^1.3.1",
"solhint": "^3.6.2"
Expand All @@ -30,5 +32,11 @@
"test": "forge test",
"test:coverage": "forge coverage",
"test:coverage:report": "forge coverage --report lcov && genhtml lcov.info --branch-coverage --output-dir coverage"
},
"dependencies": {
"ethers": "^6.12.1",
"ts-node": "^10.9.2",
"typescript": "^5.4.5",
"yargs": "^17.7.2"
}
}
81 changes: 0 additions & 81 deletions script/Deploy.s.sol

This file was deleted.

Loading