Skip to content

Commit 0b90116

Browse files
committed
feat: generate abi and build rln package as release condition
1 parent 25dce8c commit 0b90116

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

.github/workflows/ci.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,28 @@ jobs:
116116
- run: npm install
117117
if: ${{ steps.release.outputs.releases_created }}
118118

119+
- name: Setup Foundry
120+
if: ${{ steps.release.outputs.releases_created }}
121+
uses: foundry-rs/foundry-toolchain@v1
122+
with:
123+
version: nightly
124+
125+
- name: Generate RLN contract ABIs and verify build
126+
if: ${{ steps.release.outputs.releases_created }}
127+
run: |
128+
cd packages/rln
129+
npm run setup:contract-abi || {
130+
echo "Failed to generate contract ABIs, marking @waku/rln as private to skip publishing"
131+
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));"
132+
exit 0
133+
}
134+
npm run build || {
135+
echo "Failed to build @waku/rln, marking as private to skip publishing"
136+
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));"
137+
exit 0
138+
}
139+
cd ../..
140+
119141
- run: npm run build
120142
if: ${{ steps.release.outputs.releases_created }}
121143

.github/workflows/pre-release.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,26 @@ jobs:
2525

2626
- run: npm install
2727

28+
- name: Setup Foundry
29+
uses: foundry-rs/foundry-toolchain@v1
30+
with:
31+
version: nightly
32+
33+
- name: Generate RLN contract ABIs and verify build
34+
run: |
35+
cd packages/rln
36+
npm run setup:contract-abi || {
37+
echo "Failed to generate contract ABIs, marking @waku/rln as private to skip publishing"
38+
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));"
39+
exit 0
40+
}
41+
npm run build || {
42+
echo "Failed to build @waku/rln, marking as private to skip publishing"
43+
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));"
44+
exit 0
45+
}
46+
cd ../..
47+
2848
- run: npm run build
2949

3050
- run: npm run publish -- --tag next

0 commit comments

Comments
 (0)