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

Streamline our release process #2517

Merged
merged 13 commits into from
Jan 29, 2025
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
57 changes: 57 additions & 0 deletions .github/workflows/publish-crates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Publish Crates

on:
workflow_dispatch:
inputs:
version:
description: 'Version to publish (without v prefix)'
required: true
type: string

permissions:
contents: read

jobs:
publish-crates:
name: Publish crates to crates.io
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable

- name: Login to crates.io
run: cargo login ${{ secrets.CRATES_IO_TOKEN }}

# Publish crates in dependency order with retries
- name: Publish crates
run: |
publish_with_retry() {
local package=$1
local max_attempts=3
local attempt=1

while [ $attempt -le $max_attempts ]; do
echo "Attempting to publish $package (attempt $attempt/$max_attempts)"
if cargo publish -p $package; then
return 0
fi
attempt=$((attempt + 1))
[ $attempt -le $max_attempts ] && sleep 30
done
return 1
}

# First publish crypto as it has no internal dependencies
publish_with_retry pathfinder-crypto
sleep 30

# Publish common which depends on crypto
publish_with_retry pathfinder-common
sleep 30

# Publish serde which depends on common and crypto
publish_with_retry pathfinder-serde
sleep 30

# Finally publish class-hash which depends on common, crypto and serde
publish_with_retry pathfinder-class-hash
15 changes: 15 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,21 @@ on:
- v[0-9]+.*

jobs:
verify-crates:
name: Verify crates can be published
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable

# Verify each crate can be published
- name: Verify crates
run: |
for crate in crypto common serde class-hash; do
echo "Verifying pathfinder-$crate..."
cargo publish --dry-run -p pathfinder-$crate
done

create-draft-release:
runs-on: ubuntu-latest
steps:
Expand Down
50 changes: 25 additions & 25 deletions Cargo.lock

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

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.3", path = "../common" }
pathfinder-crypto = { version = "0.15.3", path = "../crypto" }
pathfinder-serde = { version = "0.15.3", path = "../serde" }
primitive-types = { workspace = true }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true, features = [
Expand Down
6 changes: 3 additions & 3 deletions crates/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ metrics = { workspace = true }
num-bigint = { workspace = true }
num-traits = "0.2"
paste = { workspace = true }
pathfinder-crypto = { path = "../crypto" }
pathfinder-crypto = { version = "0.15.3", path = "../crypto" }
pathfinder-tagged = { version = "0.1.0", path = "../tagged" }
pathfinder-tagged-debug-derive = { version = "0.1.0", path = "../tagged-debug-derive" }
primitive-types = { workspace = true, features = ["serde"] }
rand = { workspace = true }
serde = { workspace = true, features = ["derive"] }
Expand All @@ -27,8 +29,6 @@ serde_json = { workspace = true, features = [
] }
serde_with = { workspace = true }
sha3 = { workspace = true }
tagged = { path = "../tagged" }
tagged-debug-derive = { path = "../tagged-debug-derive" }
thiserror = { workspace = true }

[dev-dependencies]
Expand Down
4 changes: 2 additions & 2 deletions crates/common/src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ use std::str::FromStr;
use fake::Dummy;
use num_bigint::BigUint;
use pathfinder_crypto::Felt;
use pathfinder_tagged::Tagged;
use pathfinder_tagged_debug_derive::TaggedDebug;
use serde_with::serde_conv;
use tagged::Tagged;
use tagged_debug_derive::TaggedDebug;

use crate::{ContractAddress, EventData, EventKey};

Expand Down
8 changes: 4 additions & 4 deletions crates/p2p/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ p2p_proto = { path = "../p2p_proto" }
p2p_stream = { path = "../p2p_stream" }
pathfinder-common = { path = "../common" }
pathfinder-crypto = { path = "../crypto" }
pathfinder-tagged = { path = "../tagged" }
pathfinder-tagged-debug-derive = { path = "../tagged-debug-derive" }
pretty_assertions_sorted = { workspace = true }
primitive-types = { workspace = true }
prost = { workspace = true }
Expand All @@ -46,8 +48,6 @@ serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
sha2 = { workspace = true }
sha3 = { workspace = true }
tagged = { path = "../tagged" }
tagged-debug-derive = { path = "../tagged-debug-derive" }
tokio = { workspace = true, features = ["macros", "rt-multi-thread", "sync"] }
tokio-stream = { workspace = true }
tracing = { workspace = true }
Expand All @@ -60,10 +60,10 @@ zeroize = { workspace = true }
[dev-dependencies]
clap = { workspace = true, features = ["derive", "env", "wrap_help"] }
hex = { workspace = true }
pathfinder-tagged = { path = "../tagged" }
pathfinder-tagged-debug-derive = { path = "../tagged-debug-derive" }
rand = { workspace = true }
rstest = { workspace = true }
tagged = { path = "../tagged" }
tagged-debug-derive = { path = "../tagged-debug-derive" }
test-log = { workspace = true }
tokio = { workspace = true, features = ["test-util"] }
tracing-subscriber = { workspace = true, features = ["env-filter"] }
6 changes: 3 additions & 3 deletions crates/p2p/src/client/peer_agnostic/fixtures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ use pathfinder_common::{
TransactionHash,
TransactionIndex,
};
use pathfinder_tagged::Tagged;
use pathfinder_tagged_debug_derive::TaggedDebug;
use rand::seq::SliceRandom;
use tagged::Tagged;
use tagged_debug_derive::TaggedDebug;
use tokio::sync::Mutex;

use super::ClassDefinition;
Expand Down Expand Up @@ -95,7 +95,7 @@ impl TestTxn {
}

pub fn peer(tag: i32) -> TestPeer {
tagged::init();
pathfinder_tagged::init();
Tagged::<TestPeer>::get(format!("peer {tag}"), || TestPeer(PeerId::random()))
.unwrap()
.data
Expand Down
4 changes: 2 additions & 2 deletions crates/p2p/src/client/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ use pathfinder_common::{
TransactionHash,
TransactionIndex,
};
use tagged::Tagged;
use tagged_debug_derive::TaggedDebug;
use pathfinder_tagged::Tagged;
use pathfinder_tagged_debug_derive::TaggedDebug;

use crate::client::conv::TryFromDto;

Expand Down
4 changes: 2 additions & 2 deletions crates/p2p_proto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ libp2p-identity = { workspace = true, features = ["peerid"] }
p2p_proto_derive = { path = "../p2p_proto_derive" }
pathfinder-common = { path = "../common" }
pathfinder-crypto = { path = "../crypto" }
pathfinder-tagged = { path = "../tagged" }
pathfinder-tagged-debug-derive = { path = "../tagged-debug-derive" }
primitive-types = { workspace = true }
prost = { workspace = true }
prost-types = { workspace = true }
rand = { workspace = true }
serde_json = { workspace = true, features = ["raw_value"] }
tagged = { path = "../tagged" }
tagged-debug-derive = { path = "../tagged-debug-derive" }

[dev-dependencies]
pretty_assertions_sorted = { workspace = true }
Expand Down
4 changes: 2 additions & 2 deletions crates/p2p_proto/src/class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use std::fmt::Debug;

use fake::{Dummy, Fake, Faker};
use pathfinder_crypto::Felt;
use tagged::Tagged;
use tagged_debug_derive::TaggedDebug;
use pathfinder_tagged::Tagged;
use pathfinder_tagged_debug_derive::TaggedDebug;

use crate::common::{Hash, Iteration};
use crate::{proto, proto_field, ToProtobuf, TryFromProtobuf};
Expand Down
4 changes: 2 additions & 2 deletions crates/p2p_proto/src/event.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use fake::Dummy;
use pathfinder_crypto::Felt;
use tagged::Tagged;
use tagged_debug_derive::TaggedDebug;
use pathfinder_tagged::Tagged;
use pathfinder_tagged_debug_derive::TaggedDebug;

use crate::common::{Hash, Iteration};
use crate::{proto, proto_field, ToProtobuf, TryFromProtobuf};
Expand Down
4 changes: 2 additions & 2 deletions crates/p2p_proto/src/header.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use std::time::SystemTime;

use fake::{Dummy, Fake, Faker};
use tagged::Tagged;
use tagged_debug_derive::TaggedDebug;
use pathfinder_tagged::Tagged;
use pathfinder_tagged_debug_derive::TaggedDebug;

use crate::common::{
Address,
Expand Down
4 changes: 2 additions & 2 deletions crates/p2p_proto/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use std::fmt::Debug;

use fake::Dummy;
use pathfinder_crypto::Felt;
use tagged::Tagged;
use tagged_debug_derive::TaggedDebug;
use pathfinder_tagged::Tagged;
use pathfinder_tagged_debug_derive::TaggedDebug;

use crate::common::{Address, Hash, Iteration, VolitionDomain};
use crate::{proto, proto_field, ToProtobuf, TryFromProtobuf};
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.3", path = "../common" }
t00ts marked this conversation as resolved.
Show resolved Hide resolved
pathfinder-crypto = { version = "0.15.3", path = "../crypto" }
primitive-types = { workspace = true, features = ["serde"] }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
Expand Down
8 changes: 6 additions & 2 deletions crates/tagged-debug-derive/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
[package]
name = "tagged-debug-derive"
version = { workspace = true }
name = "pathfinder-tagged-debug-derive"
version = "0.1.0"
authors = { workspace = true }
edition = { workspace = true }
license = { workspace = true }
rust-version = { workspace = true }
description = "Debug trait derive macro for pathfinder-tagged types"
repository = "https://github.com/eqlabs/pathfinder"
keywords = ["starknet", "derive", "debug", "proc-macro"]
categories = ["development-tools::procedural-macro-helpers"]

[lib]
proc-macro = true
Expand Down
Loading