Skip to content

Commit

Permalink
Merge pull request #18 from iosis-tech/swiftness
Browse files Browse the repository at this point in the history
swiftness
  • Loading branch information
Okm165 committed Jul 21, 2024
2 parents 2892f29 + 8d9277c commit aca4f81
Show file tree
Hide file tree
Showing 78 changed files with 449 additions and 429 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ jobs:
${{ runner.os }}-cargo-build-
- name: Run verification
run: cargo run --release --bin cairovm_verifier_cli --features ${{ matrix.layout }},keccak --no-default-features -- --proof examples/proofs/${{ matrix.layout }}/cairo0_example_proof.json
run: cargo run --release --bin swiftness --features ${{ matrix.layout }},keccak --no-default-features -- --proof examples/proofs/${{ matrix.layout }}/cairo0_example_proof.json
58 changes: 58 additions & 0 deletions .github/workflows/npm_publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Manual Publish to npm

on:
workflow_dispatch:
inputs:
npm_version:
description: 'Version to publish'
required: true
default: 'patch' # could be 'patch', 'minor', 'major', or a specific version

jobs:
publish:
runs-on: ubuntu-latest

env:
WORKING_DIR: wasm-binding # define the working directory here

strategy:
fail-fast: false
matrix:
layout: ["starknet_with_keccak"]
hash: ["blake2s"]

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18' # specify your desired Node.js version

- name: Install dependencies
run: npm install
working-directory: ${{ env.WORKING_DIR }}

- name: Update version
run: npm version ${{ github.event.inputs.npm_version }} --no-git-tag-version
working-directory: ${{ env.WORKING_DIR }}

- name: Configure npm
run: npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
working-directory: ${{ env.WORKING_DIR }}

- name: Install wasm-pack
run: cargo install wasm-pack

- name: Build package
run: wasm-pack build --target web --workspace --features ${{ matrix.layout }},${{ matrix.hash }} --no-default-features --out-dir pkg
working-directory: ${{ env.WORKING_DIR }}

- name: Rename package
run: jq '.name = "swiftness-${{ matrix.layout }}-${{ matrix.hash }}"' package.json > tmp.json && mv tmp.json package.json
working-directory: ${{ env.WORKING_DIR }}/pkg

- name: Publish to npm
run: npm publish --dry-run
working-directory: ${{ env.WORKING_DIR }}/pkg
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# will have compiled files and executables
debug/
target/
pkg/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Expand All @@ -11,4 +12,4 @@ target/
**/*.rs.bk

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb
*.pdb
266 changes: 133 additions & 133 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit aca4f81

Please sign in to comment.