forked from QuorumProof/QuorumProof
-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (65 loc) · 2.59 KB
/
Copy pathdeploy-pr.yml
File metadata and controls
79 lines (65 loc) · 2.59 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
name: Deploy Testnet (PR)
on:
pull_request:
branches: [main]
types: [opened, synchronize, reopened]
jobs:
deploy-testnet:
name: Deploy to Testnet
runs-on: ubuntu-latest
environment: testnet
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
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: Install Stellar CLI
run: cargo install stellar-cli --locked
- name: Build contracts
run: ./scripts/build.sh
- name: Run tests
run: ./scripts/test.sh
- name: Deploy to testnet
id: deploy
env:
STELLAR_NETWORK: testnet
STELLAR_RPC_URL: ${{ secrets.STELLAR_RPC_URL }}
STELLAR_SECRET_KEY: ${{ secrets.STELLAR_SECRET_KEY }}
run: |
stellar keys add deployer --secret-key "$STELLAR_SECRET_KEY"
CONTRACT_QUORUM_PROOF=$(stellar contract deploy \
--wasm target/wasm32-unknown-unknown/release/quorum_proof.wasm \
--source deployer \
--network testnet)
CONTRACT_SBT_REGISTRY=$(stellar contract deploy \
--wasm target/wasm32-unknown-unknown/release/sbt_registry.wasm \
--source deployer \
--network testnet)
CONTRACT_ZK_VERIFIER=$(stellar contract deploy \
--wasm target/wasm32-unknown-unknown/release/zk_verifier.wasm \
--source deployer \
--network testnet)
echo "quorum_proof=$CONTRACT_QUORUM_PROOF" >> "$GITHUB_OUTPUT"
echo "sbt_registry=$CONTRACT_SBT_REGISTRY" >> "$GITHUB_OUTPUT"
echo "zk_verifier=$CONTRACT_ZK_VERIFIER" >> "$GITHUB_OUTPUT"
- name: Comment PR with deployment info
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `## ✅ Testnet Deployment Successful\n\n| Contract | ID |\n|---|---|\n| quorum_proof | \`${{ steps.deploy.outputs.quorum_proof }}\` |\n| sbt_registry | \`${{ steps.deploy.outputs.sbt_registry }}\` |\n| zk_verifier | \`${{ steps.deploy.outputs.zk_verifier }}\` |\n\nNetwork: \`testnet\` — Commit: \`${{ github.sha }}\``
})