-
Notifications
You must be signed in to change notification settings - Fork 149
113 lines (97 loc) · 3.72 KB
/
Copy pathdeploy-futurenet.yml
File metadata and controls
113 lines (97 loc) · 3.72 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
name: Deploy FiatBridge to Futurenet
on:
push:
branches:
- 'release/**'
paths:
- 'stellar-contracts/**'
- '.github/workflows/deploy-futurenet.yml'
permissions:
contents: read
deployments: write
jobs:
deploy:
name: Deploy to Futurenet
runs-on: ubuntu-latest
environment: futurenet
defaults:
run:
working-directory: stellar-contracts
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: wasm32-unknown-unknown
- name: Install Soroban CLI
run: |
curl -s https://raw.githubusercontent.com/stellar/rs-soroban-sdk/master/soroban-env/install-soroban.sh | bash
soroban --version
- name: Cache Cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
stellar-contracts/target
key: ${{ runner.os }}-cargo-${{ hashFiles('stellar-contracts/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Build contract
run: cargo build --target wasm32-unknown-unknown --release
- name: Deploy to Futurenet
id: deploy
env:
FUTURENET_ADMIN_SECRET_KEY: ${{ secrets.FUTURENET_ADMIN_SECRET_KEY }}
FUTURENET_RPC_URL: https://rpc-futurenet.stellar.org
FUTURENET_NETWORK_PASSPHRASE: 'Test SDF Future Network ; April 2020'
OUTPUT_FILE: ./contract_id_futurenet.txt
run: |
chmod +x ../scripts/deploy_fiat_bridge_futurenet.sh
../scripts/deploy_fiat_bridge_futurenet.sh
# Pass outputs to GitHub Actions context
CONTRACT_ID=$(cat "$OUTPUT_FILE")
echo "contract_id=$CONTRACT_ID" >> $GITHUB_OUTPUT
- name: Upload contract ID artifact
if: success()
uses: actions/upload-artifact@v4
with:
name: contract-deployment-${{ github.sha }}
path: stellar-contracts/contract_id_futurenet.txt
retention-days: 90
- name: Create deployment status
if: always()
uses: actions/github-script@v7
with:
script: |
const status = '${{ job.status }}' === 'success' ? 'success' : 'failure';
const conclusion = status === 'success' ? '✅ Deployment successful' : '❌ Deployment failed';
github.rest.repos.createDeployment({
owner: context.repo.owner,
repo: context.repo.repo,
ref: context.ref,
environment: 'futurenet',
required_contexts: [],
auto_merge: false,
description: 'FiatBridge Smart Contract Deployment'
})
- name: Post deployment summary
if: success()
run: |
echo "## 🎉 Deployment Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Status:** ✅ Success" >> $GITHUB_STEP_SUMMARY
echo "**Environment:** Futurenet" >> $GITHUB_STEP_SUMMARY
echo "**Contract ID:** ${{ steps.deploy.outputs.contract_id }}" >> $GITHUB_STEP_SUMMARY
echo "**Branch:** ${{ github.ref_name }}" >> $GITHUB_STEP_SUMMARY
echo "**Commit:** ${{ github.sha }}" >> $GITHUB_STEP_SUMMARY
- name: Notify on failure
if: failure()
run: |
echo "## ❌ Deployment Failed" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Environment: Futurenet" >> $GITHUB_STEP_SUMMARY
echo "Branch: ${{ github.ref_name }}" >> $GITHUB_STEP_SUMMARY
echo "Check the logs for details." >> $GITHUB_STEP_SUMMARY