Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci fix #20

Merged
merged 9 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading