Skip to content

Merge pull request #465 from bakarezainab/add-per-operator-withdrawal… #3

Merge pull request #465 from bakarezainab/add-per-operator-withdrawal…

Merge pull request #465 from bakarezainab/add-per-operator-withdrawal… #3

name: Deploy FiatBridge to Futurenet
on:
push:
branches:
- 'release/**'
paths:
- 'Dechat/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: Dechat/stellar-contracts
steps:
- name: Checkout repository
<<<<<<< HEAD

Check failure on line 27 in .github/workflows/deploy-futurenet.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/deploy-futurenet.yml

Invalid workflow file

You have an error in your yaml syntax on line 27
uses: actions/checkout@v4
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
=======
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- name: Set up Rust
uses: dtolnay/rust-toolchain@2c7215f132e9ebf062739d9130488b56d53c060c # stable
>>>>>>> emwulrd/main
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
<<<<<<< HEAD
uses: actions/cache@v4
=======
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
>>>>>>> emwulrd/main
with:
path: |
~/.cargo/registry
~/.cargo/git
Dechat/stellar-contracts/target
key: ${{ runner.os }}-cargo-${{ hashFiles('Dechat/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()
<<<<<<< HEAD
uses: actions/upload-artifact@v4
=======
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
>>>>>>> emwulrd/main
with:
name: contract-deployment-${{ github.sha }}
path: Dechat/stellar-contracts/contract_id_futurenet.txt
retention-days: 90
- name: Create deployment status
if: always()
<<<<<<< HEAD
uses: actions/github-script@v7
=======
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
>>>>>>> emwulrd/main
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