-
Notifications
You must be signed in to change notification settings - Fork 69
106 lines (92 loc) · 3.86 KB
/
Copy pathdeploy.yml
File metadata and controls
106 lines (92 loc) · 3.86 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
name: Deploy Soroban Contracts
on:
workflow_dispatch:
jobs:
deploy:
name: Build & Deploy to Testnet
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: "1.85.0"
targets: wasm32-unknown-unknown
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Pin incompatible dependencies
working-directory: smartcontract
run: |
cargo update serde_with@3.18.0 --precise 3.17.0 || true
cargo update serde_with_macros@3.18.0 --precise 3.17.0 || true
cargo update darling@0.23.0 --precise 0.21.3 || true
cargo update darling_core@0.23.0 --precise 0.21.3 || true
cargo update darling_macro@0.23.0 --precise 0.21.3 || true
cargo update indexmap@2.14.0 --precise 2.6.0 || true
- name: Build contracts
working-directory: smartcontract
run: |
cargo build --target wasm32-unknown-unknown --release --manifest-path=contracts/factory/Cargo.toml
cargo build --target wasm32-unknown-unknown --release --manifest-path=contracts/rotational/Cargo.toml
cargo build --target wasm32-unknown-unknown --release --manifest-path=contracts/target/Cargo.toml
cargo build --target wasm32-unknown-unknown --release --manifest-path=contracts/flexible/Cargo.toml
- name: Install Stellar CLI
run: cargo install stellar-cli
- name: Import deployer key
run: |
stellar keys add deployer --secret-key <<< "${{ secrets.DEPLOYER_SECRET_KEY }}"
- name: Deploy Factory contract
id: factory
working-directory: smartcontract
run: |
FACTORY_ID=$(stellar contract deploy \
--wasm target/wasm32-unknown-unknown/release/jointsave_factory.wasm \
--source deployer \
--network testnet)
echo "factory_id=$FACTORY_ID" >> $GITHUB_OUTPUT
echo "Factory: $FACTORY_ID"
- name: Upload Rotational wasm
id: rotational
working-directory: smartcontract
run: |
HASH=$(stellar contract upload \
--wasm target/wasm32-unknown-unknown/release/jointsave_rotational.wasm \
--source deployer \
--network testnet)
echo "hash=$HASH" >> $GITHUB_OUTPUT
echo "Rotational hash: $HASH"
- name: Upload Target wasm
id: target
working-directory: smartcontract
run: |
HASH=$(stellar contract upload \
--wasm target/wasm32-unknown-unknown/release/jointsave_target.wasm \
--source deployer \
--network testnet)
echo "hash=$HASH" >> $GITHUB_OUTPUT
echo "Target hash: $HASH"
- name: Upload Flexible wasm
id: flexible
working-directory: smartcontract
run: |
HASH=$(stellar contract upload \
--wasm target/wasm32-unknown-unknown/release/jointsave_flexible.wasm \
--source deployer \
--network testnet)
echo "hash=$HASH" >> $GITHUB_OUTPUT
echo "Flexible hash: $HASH"
- name: Print deployment summary
run: |
echo "========================================"
echo "Deployment complete. Add to frontend/.env:"
echo "========================================"
echo "NEXT_PUBLIC_FACTORY_CONTRACT_ID=${{ steps.factory.outputs.factory_id }}"
echo "NEXT_PUBLIC_ROTATIONAL_WASM_HASH=${{ steps.rotational.outputs.hash }}"
echo "NEXT_PUBLIC_TARGET_WASM_HASH=${{ steps.target.outputs.hash }}"
echo "NEXT_PUBLIC_FLEXIBLE_WASM_HASH=${{ steps.flexible.outputs.hash }}"