mirror of
https://github.com/logos-messaging/js-waku.git
synced 2026-01-02 13:53:12 +00:00
* feat: use wagmi to generate contract types * feat: migrate rln from ethers to viem * fix: remove .gitmodules * fix: update readme * fix: refactor to use a single viem client object * fix: update comments, tsconfig * feat: remove membership event tracking * fix: script name in package.json and readme * fix: only allow linea sepolia * fix: consolidate viem types, typed window * fix: use viem to infer type of decoded event * fix: use js for generate abi script * feat: generate abi and build rln package as release condition * fix: check that eth_requestAccounts returns an array * fix: handle error messages * fix: use https instead of git for cloning in script * fix: add warning annotations for contract typings check * fix: install deps for rln package before building * fix: use pnpm when installing rln contracts * fix: use workspace flag to run abi script * fix: add ref to checkout action * fix: include pnpm in ci
158 lines
4.7 KiB
YAML
158 lines
4.7 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- "master"
|
|
- "staging"
|
|
- "trying"
|
|
pull_request:
|
|
workflow_dispatch:
|
|
inputs:
|
|
nim_wakunode_image:
|
|
description: "Docker hub image name taken from https://hub.docker.com/r/wakuorg/nwaku/tags. Format: wakuorg/nwaku:v0.20.0"
|
|
required: false
|
|
type: string
|
|
|
|
env:
|
|
NODE_JS: "24"
|
|
|
|
jobs:
|
|
check:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
repository: waku-org/js-waku
|
|
|
|
- uses: actions/setup-node@v3
|
|
with:
|
|
node-version: ${{ env.NODE_JS }}
|
|
- uses: ./.github/actions/npm
|
|
- run: npm run build
|
|
- run: npm run check
|
|
- run: npm run doc
|
|
|
|
proto:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
repository: waku-org/js-waku
|
|
- uses: actions/setup-node@v3
|
|
with:
|
|
node-version: ${{ env.NODE_JS }}
|
|
- uses: ./.github/actions/npm
|
|
- name: Generate protobuf code
|
|
run: |
|
|
npm run proto
|
|
npm run fix
|
|
- name: Check all protobuf code was committed
|
|
shell: bash
|
|
run: |
|
|
res=$(git status --short --ignore-submodules)
|
|
echo -n "'$res'" # For debug purposes
|
|
[ $(echo -n "$res"|wc -l) -eq 0 ]
|
|
|
|
browser:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: mcr.microsoft.com/playwright:v1.56.1-jammy
|
|
env:
|
|
HOME: "/root"
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
repository: waku-org/js-waku
|
|
- uses: actions/setup-node@v3
|
|
with:
|
|
node-version: ${{ env.NODE_JS }}
|
|
- uses: ./.github/actions/npm
|
|
- run: npm run build:esm
|
|
- run: npm run test:browser
|
|
|
|
node:
|
|
uses: ./.github/workflows/test-node.yml
|
|
secrets: inherit
|
|
with:
|
|
nim_wakunode_image: ${{ inputs.nim_wakunode_image || 'wakuorg/nwaku:v0.36.0' }}
|
|
test_type: node
|
|
allure_reports: true
|
|
|
|
node_optional:
|
|
uses: ./.github/workflows/test-node.yml
|
|
with:
|
|
nim_wakunode_image: ${{ inputs.nim_wakunode_image || 'wakuorg/nwaku:v0.36.0' }}
|
|
test_type: node-optional
|
|
|
|
node_with_nwaku_master:
|
|
uses: ./.github/workflows/test-node.yml
|
|
with:
|
|
nim_wakunode_image: harbor.status.im/wakuorg/nwaku:latest
|
|
test_type: nwaku-master
|
|
|
|
maybe-release:
|
|
name: release
|
|
runs-on: ubuntu-latest
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
|
needs: [check, proto, browser, node]
|
|
steps:
|
|
- uses: googleapis/release-please-action@v4
|
|
id: release
|
|
with:
|
|
token: ${{ secrets.CI_TOKEN }}
|
|
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
repository: waku-org/js-waku
|
|
if: ${{ steps.release.outputs.releases_created }}
|
|
|
|
- uses: actions/setup-node@v3
|
|
if: ${{ steps.release.outputs.releases_created }}
|
|
with:
|
|
node-version: ${{ env.NODE_JS }}
|
|
registry-url: "https://registry.npmjs.org"
|
|
|
|
- uses: pnpm/action-setup@v4
|
|
if: ${{ steps.release.outputs.releases_created }}
|
|
with:
|
|
version: 9
|
|
|
|
- run: npm install
|
|
if: ${{ steps.release.outputs.releases_created }}
|
|
|
|
- run: npm run build
|
|
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
|
|
id: rln-abi
|
|
if: ${{ steps.release.outputs.releases_created }}
|
|
run: |
|
|
npm run setup:contract-abi -w @waku/rln || {
|
|
echo "::warning::Failed to generate contract ABIs, marking @waku/rln as private to skip publishing"
|
|
cd packages/rln
|
|
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));"
|
|
echo "failed=true" >> $GITHUB_OUTPUT
|
|
}
|
|
|
|
- name: Rebuild with new ABIs
|
|
if: ${{ steps.release.outputs.releases_created && steps.rln-abi.outputs.failed != 'true' }}
|
|
run: |
|
|
npm install -w packages/rln
|
|
npm run build -w @waku/rln || {
|
|
echo "::warning::Failed to build @waku/rln, marking as private to skip publishing"
|
|
cd packages/rln
|
|
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));"
|
|
}
|
|
|
|
- run: npm run publish
|
|
if: ${{ steps.release.outputs.releases_created }}
|
|
env:
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_JS_WAKU_PUBLISH }}
|