Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into sdk-state-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kroist committed Jan 17, 2025
2 parents 7f98d43 + f4125cc commit 32f2abf
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 146 deletions.
134 changes: 0 additions & 134 deletions .github/workflows/manual-publish-dev-env.yml

This file was deleted.

99 changes: 99 additions & 0 deletions .github/workflows/manual-publish-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
---
name: "Build and publish packages to npm"

on:
workflow_dispatch:
inputs:
package:
description: "Package to publish"
required: true
type: choice
options:
- shielder-sdk
- shielder-sdk-crypto
- shielder-sdk-crypto-wasm
tag:
description: "NPM tag"
required: true
type: choice
options:
- develop
- latest

jobs:
publish:
name: Build and push ${{ github.event.inputs.package }}
runs-on: [self-hosted, Linux, X64, medium]
steps:
- name: GIT | Checkout
uses: actions/checkout@v4

# Rust setup for shielder-sdk-crypto-wasm and shielder-sdk
- name: Prepare Rust env
if: |
github.event.inputs.package == 'shielder-sdk-crypto-wasm' ||
github.event.inputs.package == 'shielder-sdk'
uses: ./.github/actions/prepare-rust-env
with:
poseidon-gadget-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
zkos-circuits-private-key: ${{ secrets.ZKOS_CIRCUITS_SSH_PRIVATE_KEY }}

- name: Install wasm-pack
if: github.event.inputs.package == 'shielder-sdk-crypto-wasm'
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh

# Foundry setup for shielder-sdk
- name: Install Foundry
if: github.event.inputs.package == 'shielder-sdk'
uses: foundry-rs/[email protected]
with:
cache-key: custom-seed-coverage-${{ github.ref_name }}
cache-restore-keys: |-
contract-suite
version: nightly-31dd1f77fd9156d09836486d97963cec7f555343

- name: Install deps and compile contracts
if: github.event.inputs.package == 'shielder-sdk'
run: |
make deps
make compile-contracts
# Common Node.js setup
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 23

- uses: pnpm/action-setup@v4
with:
version: latest

# Build steps
- name: Build shielder-wasm
if: github.event.inputs.package == 'shielder-sdk-crypto-wasm'
run: make all
working-directory: crates/shielder-wasm

- name: Install dependencies (workspace)
run: pnpm install-deps
working-directory: ts

- name: Build package
run: |
if [ "${{ github.event.inputs.package }}" = "shielder-sdk" ]; then
pnpm build-package:sdk
elif [ "${{ github.event.inputs.package }}" = "shielder-sdk-crypto" ]; then
pnpm build-package:crypto
else
pnpm build-package:crypto-wasm
fi
working-directory: ts

# Publish
- name: Add .npmrc with publish token
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_PUBLISHING_KEY }}" > .npmrc
working-directory: ts/${{ github.event.inputs.package }}

- name: Publish package
run: pnpm publish --access restricted --no-git-checks --tag ${{ github.event.inputs.tag }}
working-directory: ts/${{ github.event.inputs.package }}
12 changes: 0 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,3 @@ format-rust:
lint-rust: # Lint all rust crates
lint-rust:
cargo clippy --release -- -D warnings

.PHONY: generate-tooling-dev
generate-tooling-dev: # Generate tooling-dev package
generate-tooling-dev:
cp tooling-e2e-tests/local_env.sh tooling-dev/
cp crates/shielder-relayer/run-relayer.sh tooling-dev/
cp package.json tooling-dev/
cp package-lock.json tooling-dev/
cp foundry.toml tooling-dev/
cp -r contracts tooling-dev/
cp -r scripts tooling-dev/
git rev-parse --short=7 HEAD > tooling-dev/.git-sha
3 changes: 3 additions & 0 deletions ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
"build:crypto": "pnpm --filter shielder-sdk-crypto build",
"build:crypto-wasm": "pnpm --filter shielder-sdk-crypto-wasm build",
"build:sdk": "pnpm --filter shielder-sdk build",
"build-package:crypto": "pnpm build:crypto",
"build-package:crypto-wasm": "pnpm build:crypto && pnpm build:crypto-wasm",
"build-package:sdk": "pnpm build:crypto && pnpm build:sdk",
"test": "pnpm -r test",
"lint": "pnpm -r lint",
"install-deps": "pnpm install --frozen-lockfile"
Expand Down

0 comments on commit 32f2abf

Please sign in to comment.