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

test #2515

Closed
wants to merge 2 commits into from
Closed

test #2515

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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ More expansive patch notes and explanations may be found in the specific [pathfi
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased
## [0.15.4] - 2025-01-24

### Added

Expand Down
48 changes: 24 additions & 24 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ lto = true
opt-level = 3

[workspace.package]
version = "0.15.3"
version = "0.15.4"
edition = "2021"
license = "MIT OR Apache-2.0"
rust-version = "1.81"
Expand Down
6 changes: 3 additions & 3 deletions crates/class-hash/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ rust-version = { workspace = true }

[dependencies]
anyhow = { workspace = true }
pathfinder-common = { path = "../common" }
pathfinder-crypto = { path = "../crypto" }
pathfinder-serde = { path = "../serde" }
pathfinder-common = { version = "0.15.4", path = "../common" }
pathfinder-crypto = { version = "0.15.4", path = "../crypto" }
pathfinder-serde = { version = "0.15.4", path = "../serde" }
primitive-types = { workspace = true }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true, features = [
Expand Down
2 changes: 1 addition & 1 deletion crates/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ metrics = { workspace = true }
num-bigint = { workspace = true }
num-traits = "0.2"
paste = { workspace = true }
pathfinder-crypto = { path = "../crypto" }
pathfinder-crypto = { version = "0.15.4", path = "../crypto" }
primitive-types = { workspace = true, features = ["serde"] }
rand = { workspace = true }
serde = { workspace = true, features = ["derive"] }
Expand Down
4 changes: 2 additions & 2 deletions crates/serde/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ rust-version = { workspace = true }
[dependencies]
anyhow = { workspace = true }
num-bigint = { workspace = true }
pathfinder-common = { path = "../common" }
pathfinder-crypto = { path = "../crypto" }
pathfinder-common = { version = "0.15.4", path = "../common" }
pathfinder-crypto = { version = "0.15.4", path = "../crypto" }
primitive-types = { workspace = true, features = ["serde"] }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
Expand Down
5 changes: 5 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@ dep-sort:
doc:
cargo doc --no-deps --document-private-items

release version:
chmod +x scripts/release.sh
scripts/release.sh {{version}}

alias b := build
alias t := test
alias c := check
alias f := fmt
alias r := release
72 changes: 72 additions & 0 deletions scripts/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#!/bin/bash
set -e

VERSION=$1

# Verify version format
if ! echo "$VERSION" | grep -E "^[0-9]+\.[0-9]+\.[0-9]+$" > /dev/null; then
echo "Version must be in format X.Y.Z"
exit 1
fi

# Cross-platform sed command (macOS and Linux)
do_sed() {
local file=$1
local pattern=$2
if [[ "$(uname)" == "Darwin" ]]; then
sed -i '.bak' "$pattern" "$file"
rm "${file}.bak"
else
sed -i "$pattern" "$file"
fi
}

# Update CHANGELOG.md - replace "## Unreleased" with version and date
CURRENT_DATE=$(date +%Y-%m-%d)
do_sed "CHANGELOG.md" "s/## Unreleased/## [${VERSION}] - ${CURRENT_DATE}/"

# Update workspace version
do_sed "Cargo.toml" "s/^version = \".*\"/version = \"${VERSION}\"/"

# Update versions in crate Cargo.toml files
for crate in common crypto serde class-hash; do
file="crates/${crate}/Cargo.toml"
echo "Updating dependencies for $file..."
do_sed "$file" "s/pathfinder-common = { version = \"[^\"]*\"/pathfinder-common = { version = \"${VERSION}\"/"
do_sed "$file" "s/pathfinder-crypto = { version = \"[^\"]*\"/pathfinder-crypto = { version = \"${VERSION}\"/"
do_sed "$file" "s/pathfinder-serde = { version = \"[^\"]*\"/pathfinder-serde = { version = \"${VERSION}\"/"
done

# Update Cargo.lock
cargo update -p pathfinder-common -p pathfinder-crypto -p pathfinder-serde -p pathfinder-class-hash

# Verify everything still builds
cargo check --workspace

# Create and checkout new release branch
git checkout -b release/v${VERSION}

# Create git commit and tag
git add Cargo.toml Cargo.lock crates/*/Cargo.toml CHANGELOG.md
git commit -m "chore: bump version to ${VERSION}"
git tag -a "v${VERSION}" -m "Pathfinder v${VERSION}"

# Quik recap of what was done
echo -e "\nChanges made:"
echo "- Updated workspace version to ${VERSION}"
echo "- Updated CHANGELOG.md with version ${VERSION} and date ${CURRENT_DATE}"
echo "- Updated dependency versions in public crates:"
for crate in common crypto serde class-hash; do
echo " - crates/${crate}/Cargo.toml"
done

# Confirmation before pushing
echo -e "\nPush these changes to release/v${VERSION} and create a tag v${VERSION}? (Y/n)"
read -r answer
if [[ "$answer" == "n" ]] || [[ "$answer" == "N" ]]; then
echo "Aborting push. Changes are committed locally."
exit 1
fi

# Push changes
git push --set-upstream origin release/v${VERSION} && git push origin "v${VERSION}"
Loading