-
Notifications
You must be signed in to change notification settings - Fork 2
115 lines (105 loc) · 3.34 KB
/
deploy-verify.yml
File metadata and controls
115 lines (105 loc) · 3.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: Deploy and Verify Dream-Mind-Lucid
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
inputs:
contract_name:
description: 'Contract to deploy (IEMDreams or OneiroSphere)'
required: true
default: 'OneiroSphere'
type: choice
options:
- IEMDreams
- OneiroSphere
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Install Solidity
run: |
python -c "from solcx import install_solc; install_solc('0.8.20')"
- name: Deploy Contract
env:
SKALE_RPC: ${{ secrets.SKALE_RPC }}
SKALE_CHAIN_ID: ${{ secrets.SKALE_CHAIN_ID }}
DEPLOYER_KEY: ${{ secrets.DEPLOYER_KEY }}
INFURA_PROJECT_ID: ${{ secrets.INFURA_PROJECT_ID }}
BICONOMY_API_KEY: ${{ secrets.BICONOMY_API_KEY }}
FORWARDER_ADDRESS: ${{ secrets.FORWARDER_ADDRESS }}
run: |
CONTRACT_NAME="${{ github.event.inputs.contract_name || 'OneiroSphere' }}"
echo "Deploying $CONTRACT_NAME contract..."
python agents/iem_syndicate.py deploy $CONTRACT_NAME
- name: Audit Deployment
env:
SKALE_RPC: ${{ secrets.SKALE_RPC }}
SKALE_CHAIN_ID: ${{ secrets.SKALE_CHAIN_ID }}
DEPLOYER_KEY: ${{ secrets.DEPLOYER_KEY }}
INFURA_PROJECT_ID: ${{ secrets.INFURA_PROJECT_ID }}
run: |
# Get the deployed contract address from memory
if [ -f iem_memory.json ]; then
CONTRACT_ADDRESS=$(python -c "
import json
try:
with open('iem_memory.json', 'r') as f:
data = json.load(f)
if data.get('lastDeployed'):
for name, info in data['lastDeployed'].items():
print(info['address'])
break
except:
pass
")
if [ ! -z "$CONTRACT_ADDRESS" ]; then
echo "Auditing contract at $CONTRACT_ADDRESS"
python agents/iem_syndicate.py audit $CONTRACT_ADDRESS
fi
fi
- name: Test Dream Recording
env:
SKALE_RPC: ${{ secrets.SKALE_RPC }}
SKALE_CHAIN_ID: ${{ secrets.SKALE_CHAIN_ID }}
DEPLOYER_KEY: ${{ secrets.DEPLOYER_KEY }}
INFURA_PROJECT_ID: ${{ secrets.INFURA_PROJECT_ID }}
run: |
# Record a test dream to verify deployment
if [ -f iem_memory.json ]; then
CONTRACT_ADDRESS=$(python -c "
import json
try:
with open('iem_memory.json', 'r') as f:
data = json.load(f)
if data.get('lastDeployed'):
for name, info in data['lastDeployed'].items():
print(info['address'])
break
except:
pass
")
if [ ! -z "$CONTRACT_ADDRESS" ]; then
echo "Recording test dream to contract $CONTRACT_ADDRESS"
python agents/iem_syndicate.py test "$CONTRACT_ADDRESS" "Test dream from GitHub Actions deployment - $(date)"
fi
fi
- name: Upload Deployment Artifacts
uses: actions/upload-artifact@v3
if: always()
with:
name: deployment-artifacts
path: |
iem_memory.json
*.log
retention-days: 30