From d8ca7d0e0761d118fffd5f8f253ce3ea377dcc4a Mon Sep 17 00:00:00 2001 From: Arseniy Klempner Date: Thu, 20 Nov 2025 16:45:12 -0800 Subject: [PATCH] feat: generate abi and build rln package as release condition --- .github/workflows/ci.yml | 22 ++++++++++++++++++++++ .github/workflows/pre-release.yml | 20 ++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 07654a4a3b..ec99cc2f40 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -116,6 +116,28 @@ jobs: - run: npm install if: ${{ steps.release.outputs.releases_created }} + - name: Setup Foundry + if: ${{ steps.release.outputs.releases_created }} + uses: foundry-rs/foundry-toolchain@v1 + with: + version: nightly + + - name: Generate RLN contract ABIs and verify build + if: ${{ steps.release.outputs.releases_created }} + run: | + cd packages/rln + npm run setup:contract-abi || { + echo "Failed to generate contract ABIs, marking @waku/rln as private to skip publishing" + node -e "const fs = require('fs'); const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8')); pkg.private = true; fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2));" + exit 0 + } + npm run build || { + echo "Failed to build @waku/rln, marking as private to skip publishing" + node -e "const fs = require('fs'); const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8')); pkg.private = true; fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2));" + exit 0 + } + cd ../.. + - run: npm run build if: ${{ steps.release.outputs.releases_created }} diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index 659676f47e..5ccf41befe 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -25,6 +25,26 @@ jobs: - run: npm install + - name: Setup Foundry + uses: foundry-rs/foundry-toolchain@v1 + with: + version: nightly + + - name: Generate RLN contract ABIs and verify build + run: | + cd packages/rln + npm run setup:contract-abi || { + echo "Failed to generate contract ABIs, marking @waku/rln as private to skip publishing" + node -e "const fs = require('fs'); const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8')); pkg.private = true; fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2));" + exit 0 + } + npm run build || { + echo "Failed to build @waku/rln, marking as private to skip publishing" + node -e "const fs = require('fs'); const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8')); pkg.private = true; fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2));" + exit 0 + } + cd ../.. + - run: npm run build - run: npm run publish -- --tag next