-
Notifications
You must be signed in to change notification settings - Fork 9
86 lines (82 loc) · 3.03 KB
/
Copy pathdeploy.yml
File metadata and controls
86 lines (82 loc) · 3.03 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
name: Deploy
on:
push:
branches: [main]
tags: ["v*.*.*"]
env:
CARGO_TERM_COLOR: always
jobs:
deploy-testnet:
if: github.ref_name == 'main'
name: Deploy to Testnet
runs-on: ubuntu-latest
environment: testnet
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- uses: Swatinem/rust-cache@v2
- name: Install system dependencies
run: |
sudo apt update
sudo apt install -y libdbus-1-dev pkg-config libudev-dev
- name: Install soroban-cli
run: |
cargo install soroban-cli --locked
- name: Build contracts (always runs to check build)
run: |
cargo build --release --target wasm32-unknown-unknown --workspace --exclude propfi-integration-tests
- name: Create .env and configure soroban keys
if: ${{ secrets.ADMIN_SECRET_KEY != '' }}
run: |
cat > .env <<EOF
ADMIN_KEY_NAME=deployer
ADMIN_PUBLIC_KEY=${{ secrets.ADMIN_PUBLIC_KEY }}
STALENESS_THRESHOLD=${{ vars.STALENESS_THRESHOLD || '3600' }}
EOF
# Use --secret-key directly with the value
soroban keys add deployer --secret-key "${{ secrets.ADMIN_SECRET_KEY }}" --network testnet
- name: Deploy contracts
if: ${{ secrets.ADMIN_SECRET_KEY != '' }}
run: |
./scripts/deploy.sh --network testnet
deploy-mainnet:
if: startsWith(github.ref, 'refs/tags/v')
name: Deploy to Mainnet
runs-on: ubuntu-latest
environment: mainnet
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- uses: Swatinem/rust-cache@v2
- name: Install system dependencies
run: |
sudo apt update
sudo apt install -y libdbus-1-dev pkg-config libudev-dev
- name: Install soroban-cli
run: |
cargo install soroban-cli --locked
- name: Build contracts (always runs to check build)
run: |
cargo build --release --target wasm32-unknown-unknown --workspace --exclude propfi-integration-tests
- name: Create .env and configure soroban keys
if: ${{ secrets.ADMIN_SECRET_KEY != '' }}
run: |
cat > .env <<EOF
ADMIN_KEY_NAME=deployer
ADMIN_PUBLIC_KEY=${{ secrets.ADMIN_PUBLIC_KEY }}
STALENESS_THRESHOLD=${{ vars.STALENESS_THRESHOLD || '3600' }}
USDC_CONTRACT_ID=${{ secrets.USDC_CONTRACT_ID }}
XLM_CONTRACT_ID=${{ secrets.XLM_CONTRACT_ID }}
ORACLE_PUBLIC_KEYS=${{ secrets.ORACLE_PUBLIC_KEYS }}
ORACLE_WEIGHTS=${{ vars.ORACLE_WEIGHTS || '' }}
EOF
# Use --secret-key directly with the value
soroban keys add deployer --secret-key "${{ secrets.ADMIN_SECRET_KEY }}" --network mainnet
- name: Deploy contracts
if: ${{ secrets.ADMIN_SECRET_KEY != '' }}
run: |
./scripts/deploy.sh --network mainnet --confirm