From cb7dc7222b44bf9f05e45ca140ed2f83f0971cbe Mon Sep 17 00:00:00 2001 From: MarcusDavidG Date: Mon, 15 Jun 2026 11:20:10 +0100 Subject: [PATCH 1/3] chore: add test_snapshots/ and sharpy binary to .gitignore --- .gitignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 44ef38d..5554c2e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ # Rust -target/ +target +sharpy +test_snapshots// Cargo.lock *.rlib *.so From e3f3048eb659ccd9fd242867e95b648a6174a3da Mon Sep 17 00:00:00 2001 From: MarcusDavidG Date: Mon, 15 Jun 2026 11:20:10 +0100 Subject: [PATCH 2/3] chore: add Makefile for build, test, and deploy commands Provides make build, optimize, test, deploy-testnet, deploy-mainnet and init-testnet targets. --- Makefile | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..5418e7f --- /dev/null +++ b/Makefile @@ -0,0 +1,36 @@ +.PHONY: build optimize test deploy-testnet deploy-mainnet + +WASM=target/wasm32-unknown-unknown/release/sharpy.wasm +OPTIMIZED=target/wasm32-unknown-unknown/release/sharpy.optimized.wasm +TESTNET_ID=CAYTIFPD6RFWVHMK5SPPUUIWWAAANHKOJB6GOAJS5SR5MBKZMEY2UODZ + +build: + cargo build --release --target wasm32-unknown-unknown + +optimize: build + stellar contract optimize --wasm $(WASM) + +test: + cargo test + +deploy-testnet: optimize + stellar contract deploy \ + --wasm $(OPTIMIZED) \ + --source alice \ + --network testnet + +init-testnet: + stellar contract invoke \ + --id $(TESTNET_ID) \ + --source alice \ + --network testnet \ + -- initialize \ + --admin $(ADMIN) \ + --treasury $(TREASURY) + +deploy-mainnet: optimize + stellar contract deploy \ + --wasm $(OPTIMIZED) \ + --source deployer \ + --rpc-url https://mainnet.sorobanrpc.com \ + --network-passphrase "Public Global Stellar Network ; September 2015" From 5523fa064b758cba7463023eea5320af75fe42f7 Mon Sep 17 00:00:00 2001 From: MarcusDavidG Date: Mon, 15 Jun 2026 11:20:10 +0100 Subject: [PATCH 3/3] ci: add GitHub Actions workflow On push/PR to main: - cargo test - cargo build --release --target wasm32-unknown-unknown - stellar contract optimize - upload optimized WASM as artifact --- .github/workflows/ci.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e82ba89 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,34 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install Rust wasm32 target + run: rustup target add wasm32-unknown-unknown + + - name: Run tests + run: cargo test + + - name: Build WASM + run: cargo build --release --target wasm32-unknown-unknown + + - name: Install Stellar CLI + run: cargo install --locked stellar-cli --features opt + + - name: Optimize WASM + run: stellar contract optimize --wasm target/wasm32-unknown-unknown/release/sharpy.wasm + + - name: Upload optimized WASM artifact + uses: actions/upload-artifact@v4 + with: + name: sharpy.optimized.wasm + path: target/wasm32-unknown-unknown/release/sharpy.optimized.wasm