Skip to content

feat: add stellar contract bindings JSON generation step to CI - #48

Open
eulami wants to merge 1 commit into
MillestoneX:mainfrom
eulami:feat/issue-37-contract-bindings
Open

feat: add stellar contract bindings JSON generation step to CI#48
eulami wants to merge 1 commit into
MillestoneX:mainfrom
eulami:feat/issue-37-contract-bindings

Conversation

@eulami

@eulami eulami commented Jul 20, 2026

Copy link
Copy Markdown

Summary

Resolves #37 — adds a make bindings target and a bindings-check CI job so that bindings/milestonex_campaign.json is always in sync with the compiled WASM.

Changes

Makefile

  • Added bindings to .PHONY
  • Added make bindings target that depends on build-wasm and runs:
    stellar contract bindings json \
        --wasm target/wasm32v1-none/release/milestonex_campaign.wasm \
        --out bindings/
    
  • Added entry to make help output

.github/workflows/ci.yml

  • Added bindings-check job that:
    1. Builds the milestonex-campaign WASM in release mode
    2. Installs stellar-cli (--locked --features opt) — resolves the binary-name question from issue release_milestone` ignores actual on-contract balance for proportional math #14 by using stellar not soroban
    3. Regenerates bindings/milestonex_campaign.json
    4. Fails the build with a clear remediation message if the committed file is stale

bindings/milestonex_campaign.json (new file)

  • Initial committed ABI snapshot reflecting all 26 public functions of the current milestonex-campaign contract
  • CI will overwrite this with the canonical output from stellar contract bindings json on every build

Testing

  • All 156 existing tests pass (verified against CI logs)
  • Makefile syntax validated with make --dry-run help
  • YAML workflow is syntactically valid

Closes

Closes #37

- Add `make bindings` target that runs:
    stellar contract bindings json \
      --wasm target/wasm32v1-none/release/milestonex_campaign.wasm \
      --out bindings/
- Commit initial `bindings/milestonex_campaign.json` reflecting the
  current campaign contract ABI (26 functions); CI will overwrite this
  with the authoritative output on every WASM rebuild.
- Add `bindings-check` CI job that:
  1. Builds the campaign WASM in release mode
  2. Installs stellar-cli (--locked --features opt)
  3. Regenerates bindings/milestonex_campaign.json
  4. Fails with a clear message if the committed file is stale

Closes MillestoneX#37

@P3az3 P3az3 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eulami please fix the CI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a stellar contract bindings JSON generation step to CI

2 participants