diff --git a/.gitea/workflows/deploy-devnet.yml b/.gitea/workflows/deploy-devnet.yml index 3b270f8..cbbdf09 100644 --- a/.gitea/workflows/deploy-devnet.yml +++ b/.gitea/workflows/deploy-devnet.yml @@ -9,11 +9,45 @@ jobs: deploy-devnet: runs-on: ubuntu-latest steps: - - name: Debug env + network + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Rust toolchain + C compiler run: | - echo "=== ENV (proxy/actions) ===" - env | grep -iE 'proxy|ACTIONS|GITHUB_TOKEN|RUNNER' | sort - echo "=== curl github ===" - curl -sS -o /dev/null -w "github HTTP %{http_code}\n" --max-time 10 https://github.com/actions/checkout 2>&1 | tail -1 - echo "=== curl rustup ===" - curl -sS -o /dev/null -w "rustup HTTP %{http_code}\n" --max-time 10 https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-init 2>&1 | tail -1 \ No newline at end of file + apt-get update + apt-get install -y --no-install-recommends build-essential pkg-config libssl-dev clang + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \ + sh -s -- -y --profile minimal --default-toolchain 1.89.0 + + - name: Setup Solana CLI + run: | + sh -c "$(curl -sSfL https://release.solana.com/v1.18.26/install)" + echo "$HOME/.local/share/solana/install/active_release/bin" >> "$GITHUB_PATH" + echo "$HOME/.cargo/bin" >> "$GITHUB_PATH" + + - name: Setup Anchor CLI (anchor-next) + run: | + . "$HOME/.cargo/env" + cargo install --force --git https://github.com/anchor-lang/anchor.git \ + --branch anchor-next anchor-cli --locked + echo "$HOME/.cargo/bin" >> "$GITHUB_PATH" + + - name: Airdrop devnet SOL (to keypair address) + run: | + solana airdrop 2 9ALsnxXNzDBv3mokngCHbruRTWUZiWR7pf7vswS1fCpf \ + --url https://api.devnet.solana.com || \ + solana airdrop 2 9ALsnxXNzDBv3mokngCHbruRTWUZiWR7pf7vswS1fCpf \ + --url https://api.devnet.solana.com + + - name: Build program + working-directory: program + run: anchor build + + - name: Test program + working-directory: program + run: anchor test + + - name: Deploy to devnet + working-directory: program + run: anchor deploy --provider.cluster devnet \ + --provider.wallet ../deploy/dev_smart_updown-keypair.json \ No newline at end of file