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

Web3review v2 #15

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
publish crate
  • Loading branch information
wasabrot committed Apr 9, 2024
commit 81b0c4955a08ffe0660cd135245b4ff0e86842a8
2 changes: 1 addition & 1 deletion Cargo.lock

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

66 changes: 66 additions & 0 deletions cratePublish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#!/bin/bash
set -e

echo "assumed that cargo login is already done"

function check_and_print_version() {
# Get the Cargo.toml path from the function argument
cargo_toml_path="$1"

# Check if Cargo.toml path exists
if [[ ! -f "$cargo_toml_path" ]]; then
echo "Error: Cargo.toml file not found at: $cargo_toml_path"
exit 1
fi

# Get the current version from cargo.toml (without "v" prefix)
current_version=$(grep -Eo 'version = \"[0-9]*\.[0-9]*\.[0-9]*\"' "$cargo_toml_path" | cut -d '"' -f2)

if [[ -z "$current_version" ]]; then
echo "Error: Could not find version in Cargo.toml"
exit 1
fi
echo "Current version in Cargo.toml: $current_version"
# Get the latest semantic version tag (without "v") from GitHub
# Get the latest semantic version tag (without "v") from GitHub (alternative)
latest_version=$(git tag -l --sort=-v:refname | head -n 1 | cut -d 'v' -f2)

if [[ -z "$latest_version" ]]; then
echo "No semantic version tag starting with 'v' found!"
exit 1
fi

# Check for version mismatch
if [[ "$current_version" != "$latest_version" ]]; then
echo "Version mismatch!"
echo " Cargo.toml version: $current_version"
echo " Latest version from tags: $latest_version"
echo " Cargo.toml path: $cargo_toml_path"

# Prompt user to update Cargo.toml version
read -p "Do you want to update the Cargo.toml version to $latest_version (y/N)? " answer
case "$answer" in
[Yy]*)
# Update Cargo.toml with the latest version (assuming you have write permissions)
sed -i "s/version = \"$current_version\"/version = \"$latest_version\"/" "$cargo_toml_path"
echo "Updated Cargo.toml version to: $latest_version"
;;
[Nn]*)
echo "Skipping Cargo.toml version update."
;;
*)
echo "Invalid input. Please enter 'y' or 'N'."
;;
esac
fi
}


check_and_print_version "./host/Cargo.toml"
cargo publish --dry-run -p fridge-r0-client


check_and_print_version "./verifier/Cargo.toml"
cargo publish --dry-run -p fridge-r0-verifier


5 changes: 3 additions & 2 deletions host/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fridge-r0-client"
version = "0.1.0"
version = "0.0.32"
edition = "2021"
license = "MIT"
authors = ["Walter Strametz <walter.strametz@element36.io>"]
@@ -12,7 +12,7 @@ path = "src/main.rs"

[dependencies]
# from template
methods = { path = "../methods" }
methods = { path = "../methods",version = "*" }
# Define the risc0-zkvm crate with features for testing only
#risc0-zkvm = { version = "0.19.1", features = ["profiler", "prove", "getrandom" ] }
risc0-zkvm = { workspace = true, features = [ "prove", "getrandom"] }
@@ -39,6 +39,7 @@ clap-markdown = "0.1"
#metal = ["risc0-zkvm/metal"]

[dependencies.sha2]
version = "0.1.0" # Dummy version
git = "https://github.com/risc0/RustCrypto-hashes"
tag = "sha2-v0.10.6-risczero.0"

1 change: 1 addition & 0 deletions host/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
For documentation, see [github](https://github.com/element36-io/hyperfridge-r0/).
1 change: 1 addition & 0 deletions methods/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
For documentation, see [github](https://github.com/element36-io/hyperfridge-r0/).
1 change: 1 addition & 0 deletions methods/guest/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
For documentation, see [github](https://github.com/element36-io/hyperfridge-r0/).
2 changes: 1 addition & 1 deletion verifier/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fridge-r0-verifier"
version = "0.1.0"
version = "0.0.32"
edition = "2021"
license = "MIT"
authors = ["Walter Strametz <walter.strametz@element36.io>"]
1 change: 1 addition & 0 deletions verifier/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
For documentation, see [github](https://github.com/element36-io/hyperfridge-r0/).