Skip to content

Commit

Permalink
Merge pull request #20 from iosis-tech/swiftness
Browse files Browse the repository at this point in the history
ci fix
  • Loading branch information
Okm165 authored Jul 22, 2024
2 parents 084ae86 + 89494a2 commit 91a3796
Show file tree
Hide file tree
Showing 12 changed files with 52 additions and 43 deletions.
44 changes: 26 additions & 18 deletions .github/workflows/npm_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ 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:
Expand All @@ -18,8 +13,8 @@ jobs:
strategy:
fail-fast: false
matrix:
layout: ["starknet_with_keccak"]
hash: ["blake2s"]
layout: ["dex", "recursive", "recursive_with_poseidon", "small", "starknet", "starknet_with_keccak"]
hash: ["blake2s", "keccak"]

steps:
- name: Checkout repository
Expand All @@ -30,29 +25,42 @@ jobs:
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: Cache Cargo registry
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-
- name: Cache Cargo build
uses: actions/cache@v2
with:
path: target
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-build-
- 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
run: wasm-pack build --out-dir pkg --target web --workspace --features ${{ matrix.layout }},${{ matrix.hash }} --no-default-features
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
run: |
jq --arg layout "${{ matrix.layout }}" --arg hash "${{ matrix.hash }}" \
'.name = "swiftness-\($layout | gsub("_"; "-"))-\($hash | gsub("_"; "-"))"' \
package.json > tmp.json && mv tmp.json package.json
working-directory: ${{ env.WORKING_DIR }}/pkg

- name: Publish to npm
run: npm publish --dry-run
run: npm publish
working-directory: ${{ env.WORKING_DIR }}/pkg
18 changes: 9 additions & 9 deletions Cargo.lock

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

15 changes: 8 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ edition = "2021"
license-file = "LICENSE"
readme = "README.md"
repository = "https://github.com/iosis-tech/swiftness"
version = "0.0.4"

[workspace.dependencies]
bail-out = "0.2.0"
Expand All @@ -37,10 +38,10 @@ num-bigint = { version = "0.4.4", features = ["serde"] }
blake2 = "0.10.6"
wasm-bindgen = "0.2"

swiftness_air = { path = "crates/air", default-features = false, version = "0.0.3" }
swiftness_commitment = { path = "crates/commitment", default-features = false, version = "0.0.3" }
swiftness_fri = { path = "crates/fri", default-features = false, version = "0.0.3" }
swiftness_pow = { path = "crates/pow", default-features = false, version = "0.0.3" }
swiftness_stark = { path = "crates/stark", default-features = false, version = "0.0.3" }
swiftness_transcript = { path = "crates/transcript", default-features = false, version = "0.0.3" }
swiftness_proof_parser = { path = "proof-parser", default-features = false, version = "0.0.3" }
swiftness_air = { path = "crates/air", default-features = false, version = "0.0.4" }
swiftness_commitment = { path = "crates/commitment", default-features = false, version = "0.0.4" }
swiftness_fri = { path = "crates/fri", default-features = false, version = "0.0.4" }
swiftness_pow = { path = "crates/pow", default-features = false, version = "0.0.4" }
swiftness_stark = { path = "crates/stark", default-features = false, version = "0.0.4" }
swiftness_transcript = { path = "crates/transcript", default-features = false, version = "0.0.4" }
swiftness_proof_parser = { path = "proof-parser", default-features = false, version = "0.0.4" }
2 changes: 1 addition & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition.workspace = true
license-file.workspace = true
readme.workspace = true
repository.workspace = true
version = "0.0.3"
version.workspace = true

[dependencies]
clap = { version = "4.4.4", features = ["derive"] }
Expand Down
2 changes: 1 addition & 1 deletion crates/air/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition.workspace = true
license-file.workspace = true
readme = "README.md"
repository.workspace = true
version = "0.0.3"
version.workspace = true

[dependencies]
bail-out.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/commitment/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition.workspace = true
license-file.workspace = true
readme = "README.md"
repository.workspace = true
version = "0.0.3"
version.workspace = true

[dependencies]
serde_with.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/fri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition.workspace = true
license-file.workspace = true
readme = "README.md"
repository.workspace = true
version = "0.0.3"
version.workspace = true

[dependencies]
serde_with.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/pow/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition.workspace = true
license-file.workspace = true
readme = "README.md"
repository.workspace = true
version = "0.0.3"
version.workspace = true

[dependencies]
bail-out.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/stark/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition.workspace = true
license-file.workspace = true
readme = "README.md"
repository.workspace = true
version = "0.0.3"
version.workspace = true

[dependencies]
bail-out.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/transcript/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition.workspace = true
license-file.workspace = true
readme = "README.md"
repository.workspace = true
version = "0.0.3"
version.workspace = true

[dependencies]
starknet-crypto.workspace = true
2 changes: 1 addition & 1 deletion proof-parser/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition.workspace = true
license-file.workspace = true
readme = "README.md"
repository.workspace = true
version = "0.0.3"
version.workspace = true

[dependencies]
serde.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion wasm-binding/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition.workspace = true
license = "Apache-2.0"
readme = "README.md"
repository.workspace = true
version = "0.0.3"
version.workspace = true

[dependencies]
serde_json.workspace = true
Expand Down

0 comments on commit 91a3796

Please sign in to comment.