fix: fund deployer via Friendbot before testnet deploy #75
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy to Testnet | |
| on: | |
| push: | |
| branches: [main] | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| 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 system dependencies | |
| run: sudo apt-get update && sudo apt-get install -y libdbus-1-dev libudev-dev pkg-config | |
| - name: Install stellar-cli | |
| run: cargo install --locked stellar-cli | |
| - name: Build contract (release) | |
| run: cargo build --target wasm32-unknown-unknown --release --package split | |
| - name: Configure testnet identity | |
| run: stellar keys generate deployer --network testnet | |
| - name: Fund deployer account via Friendbot | |
| run: | | |
| ADDR=$(stellar keys address deployer) | |
| echo "Funding $ADDR via Friendbot..." | |
| curl -s -f "https://friendbot.stellar.org?addr=$ADDR" > /dev/null | |
| echo "Account funded." | |
| - name: Deploy contract | |
| run: | | |
| stellar contract deploy \ | |
| --wasm target/wasm32-unknown-unknown/release/split.wasm \ | |
| --source deployer \ | |
| --network testnet \ | |
| --rpc-url https://soroban-testnet.stellar.org \ | |
| --network-passphrase "Test SDF Network ; September 2015" |