diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bd260eb741a..04dab309902 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -61,16 +61,32 @@ jobs: with: tool: tomlq + - name: Extract version from manifest + run: | + CRATE_VERSION=$(cargo metadata --format-version=1 --no-deps | jq -e -r '.packages[] | select(.name == "'"$CRATE"'") | .version') + + echo "CRATE_VERSION=$CRATE_VERSION" >> $GITHUB_ENV + - name: Enforce version in `workspace.dependencies` matches latest version if: env.CRATE != 'libp2p' run: | - PACKAGE_VERSION=$(cargo metadata --format-version=1 --no-deps | jq -e -r '.packages[] | select(.name == "'"$CRATE"'") | .version') SPECIFIED_VERSION=$(tomlq "workspace.dependencies.$CRATE.version" --file ./Cargo.toml) - echo "Package version: $PACKAGE_VERSION"; + echo "Package version: $CRATE_VERSION"; echo "Specified version: $SPECIFIED_VERSION"; - test "$PACKAGE_VERSION" = "$SPECIFIED_VERSION" || test "=$PACKAGE_VERSION" = "$SPECIFIED_VERSION" + test "$CRATE_VERSION" = "$SPECIFIED_VERSION" || test "=$CRATE_VERSION" = "$SPECIFIED_VERSION" + + - name: Enforce version in CHANGELOG.md matches version in manifest + run: | + MANIFEST_PATH=$(cargo metadata --format-version=1 --no-deps | jq -e -r '.packages[] | select(.name == "'"$CRATE"'") | .manifest_path') + DIR_TO_CRATE=$(dirname "$MANIFEST_PATH") + VERSION_IN_CHANGELOG=$(awk -F' ' '/^## [0-9]+\.[0-9]+\.[0-9]+/{print $2; exit}' "$DIR_TO_CRATE/CHANGELOG.md") + + echo "Package version: $CRATE_VERSION"; + echo "Changelog version: $VERSION_IN_CHANGELOG"; + + test "$CRATE_VERSION" = "$VERSION_IN_CHANGELOG" - name: Ensure manifest and CHANGELOG are properly updated if: > diff --git a/Cargo.lock b/Cargo.lock index 9441bed6a0c..e91391a515a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -849,9 +849,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.8" +version = "4.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2275f18819641850fa26c89acc84d465c1bf91ce57bc2748b28c420473352f64" +checksum = "41fffed7514f420abec6d183b1d3acfd9099c79c3a10a06ade4f8203f1411272" dependencies = [ "clap_builder", "clap_derive", @@ -859,9 +859,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.8" +version = "4.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07cdf1b148b25c1e1f7a42225e30a0d99a615cd4637eae7365548dd4529b95bc" +checksum = "63361bae7eef3771745f02d8d892bec2fee5f6e34af316ba556e7f97a7069ff1" dependencies = [ "anstream", "anstyle", diff --git a/examples/autonat/Cargo.toml b/examples/autonat/Cargo.toml index 5cfa11c0aa6..cca3b5e326e 100644 --- a/examples/autonat/Cargo.toml +++ b/examples/autonat/Cargo.toml @@ -10,7 +10,7 @@ release = false [dependencies] tokio = { version = "1.34", features = ["full"] } -clap = { version = "4.4.8", features = ["derive"] } +clap = { version = "4.4.10", features = ["derive"] } futures = "0.3.29" libp2p = { path = "../../libp2p", features = ["tokio", "tcp", "noise", "yamux", "autonat", "identify", "macros"] } tracing = "0.1.37" diff --git a/examples/browser-webrtc/Cargo.toml b/examples/browser-webrtc/Cargo.toml index 59948fea0d7..2607d0c1056 100644 --- a/examples/browser-webrtc/Cargo.toml +++ b/examples/browser-webrtc/Cargo.toml @@ -37,7 +37,7 @@ mime_guess = "2.0.4" js-sys = "0.3.66" libp2p = { path = "../../libp2p", features = [ "ed25519", "macros", "ping", "wasm-bindgen"] } libp2p-webrtc-websys = { workspace = true } -wasm-bindgen = "0.2.88" +wasm-bindgen = "0.2.89" wasm-bindgen-futures = "0.4.38" wasm-logger = { version = "0.2.0" } web-sys = { version = "0.3", features = ['Document', 'Element', 'HtmlElement', 'Node', 'Response', 'Window'] } diff --git a/examples/dcutr/Cargo.toml b/examples/dcutr/Cargo.toml index c65e2ca91e6..8dcb403218e 100644 --- a/examples/dcutr/Cargo.toml +++ b/examples/dcutr/Cargo.toml @@ -9,7 +9,7 @@ license = "MIT" release = false [dependencies] -clap = { version = "4.4.8", features = ["derive"] } +clap = { version = "4.4.10", features = ["derive"] } futures = "0.3.29" futures-timer = "3.0" libp2p = { path = "../../libp2p", features = [ "dns", "dcutr", "identify", "macros", "noise", "ping", "quic", "relay", "rendezvous", "tcp", "tokio", "yamux"] } diff --git a/examples/file-sharing/Cargo.toml b/examples/file-sharing/Cargo.toml index d4c0ad13fed..52d1b3b9b20 100644 --- a/examples/file-sharing/Cargo.toml +++ b/examples/file-sharing/Cargo.toml @@ -11,7 +11,7 @@ release = false [dependencies] serde = { version = "1.0", features = ["derive"] } async-std = { version = "1.12", features = ["attributes"] } -clap = { version = "4.4.8", features = ["derive"] } +clap = { version = "4.4.10", features = ["derive"] } either = "1.9" futures = "0.3.29" libp2p = { path = "../../libp2p", features = [ "async-std", "cbor", "dns", "kad", "noise", "macros", "request-response", "tcp", "websocket", "yamux"] } diff --git a/examples/ipfs-kad/Cargo.toml b/examples/ipfs-kad/Cargo.toml index 8c1ecebf022..7870d3adb79 100644 --- a/examples/ipfs-kad/Cargo.toml +++ b/examples/ipfs-kad/Cargo.toml @@ -11,7 +11,7 @@ release = false [dependencies] tokio = { version = "1.34", features = ["rt-multi-thread", "macros"] } async-trait = "0.1" -clap = { version = "4.4.8", features = ["derive"] } +clap = { version = "4.4.10", features = ["derive"] } env_logger = "0.10" futures = "0.3.29" anyhow = "1.0.75" diff --git a/examples/relay-server/Cargo.toml b/examples/relay-server/Cargo.toml index 8cab5bedeab..fe18106e60c 100644 --- a/examples/relay-server/Cargo.toml +++ b/examples/relay-server/Cargo.toml @@ -9,7 +9,7 @@ license = "MIT" release = false [dependencies] -clap = { version = "4.4.8", features = ["derive"] } +clap = { version = "4.4.10", features = ["derive"] } async-std = { version = "1.12", features = ["attributes"] } async-trait = "0.1" futures = "0.3.2" diff --git a/misc/keygen/Cargo.toml b/misc/keygen/Cargo.toml index 82619a1035d..9c1c37bd428 100644 --- a/misc/keygen/Cargo.toml +++ b/misc/keygen/Cargo.toml @@ -13,7 +13,7 @@ publish = false release = false [dependencies] -clap = { version = "4.4.8", features = ["derive"] } +clap = { version = "4.4.10", features = ["derive"] } zeroize = "1" serde = { version = "1.0.193", features = ["derive"] } serde_json = "1.0.108" diff --git a/misc/server/Cargo.toml b/misc/server/Cargo.toml index 9cc77b09d18..ba848eaeadb 100644 --- a/misc/server/Cargo.toml +++ b/misc/server/Cargo.toml @@ -12,7 +12,7 @@ license = "MIT" [dependencies] base64 = "0.21" -clap = { version = "4.4.8", features = ["derive"] } +clap = { version = "4.4.10", features = ["derive"] } futures = "0.3" futures-timer = "3" hyper = { version = "0.14", features = ["server", "tcp", "http1"] } diff --git a/protocols/dcutr/Cargo.toml b/protocols/dcutr/Cargo.toml index 1c2b0b52d5f..1fc4b367dc8 100644 --- a/protocols/dcutr/Cargo.toml +++ b/protocols/dcutr/Cargo.toml @@ -29,7 +29,7 @@ futures-bounded = { workspace = true } [dev-dependencies] async-std = { version = "1.12.0", features = ["attributes"] } -clap = { version = "4.4.8", features = ["derive"] } +clap = { version = "4.4.10", features = ["derive"] } libp2p-dns = { workspace = true, features = ["async-std"] } libp2p-identify = { workspace = true } libp2p-noise = { workspace = true } diff --git a/protocols/perf/Cargo.toml b/protocols/perf/Cargo.toml index 4d001e87d30..c2fc146f231 100644 --- a/protocols/perf/Cargo.toml +++ b/protocols/perf/Cargo.toml @@ -12,7 +12,7 @@ categories = ["network-programming", "asynchronous"] [dependencies] anyhow = "1" -clap = { version = "4.4.8", features = ["derive"] } +clap = { version = "4.4.10", features = ["derive"] } futures = "0.3.29" futures-bounded = { workspace = true } futures-timer = "3.0" diff --git a/scripts/ensure-version-bump-and-changelog.sh b/scripts/ensure-version-bump-and-changelog.sh index 1470ec3a5e4..a7a0992005a 100755 --- a/scripts/ensure-version-bump-and-changelog.sh +++ b/scripts/ensure-version-bump-and-changelog.sh @@ -10,15 +10,6 @@ MERGE_BASE=$(git merge-base "$HEAD_SHA" "$PR_BASE") # Find the merge base. This SRC_DIFF_TO_BASE=$(git diff "$HEAD_SHA".."$MERGE_BASE" --name-status -- "$DIR_TO_CRATE/src" "$DIR_TO_CRATE/Cargo.toml") CHANGELOG_DIFF=$(git diff "$HEAD_SHA".."$MERGE_BASE" --name-only -- "$DIR_TO_CRATE/CHANGELOG.md") -VERSION_IN_CHANGELOG=$(awk -F' ' '/^## [0-9]+\.[0-9]+\.[0-9]+/{print $2; exit}' "$DIR_TO_CRATE/CHANGELOG.md") -VERSION_IN_MANIFEST=$(cargo metadata --format-version=1 --no-deps | jq -e -r '.packages[] | select(.name == "'"$CRATE"'") | .version') - -# First, ensure version in Cargo.toml and CHANGELOG are in sync. This should always hold, regardless of whether the code in the crate was modified. -if [[ "$VERSION_IN_CHANGELOG" != "$VERSION_IN_MANIFEST" ]]; then - echo "Version in Cargo.toml ($VERSION_IN_MANIFEST) does not match version in CHANGELOG ($VERSION_IN_CHANGELOG)" - exit 1 -fi - # If the source files of this crate weren't touched in this PR, exit early. if [ -z "$SRC_DIFF_TO_BASE" ]; then exit 0; @@ -31,7 +22,7 @@ if [ -z "$CHANGELOG_DIFF" ]; then fi # Code was touched, ensure the version used in the manifest hasn't been released yet. -if git tag | grep -q "^$CRATE-v${VERSION_IN_MANIFEST}$"; then - echo "v$VERSION_IN_MANIFEST of '$CRATE' has already been released, please bump the version." +if git tag | grep -q "^$CRATE-v${CRATE_VERSION}$"; then + echo "v$CRATE_VERSION of '$CRATE' has already been released, please bump the version." exit 1 fi diff --git a/transports/webrtc-websys/Cargo.toml b/transports/webrtc-websys/Cargo.toml index 5e74b926b19..44607de30c0 100644 --- a/transports/webrtc-websys/Cargo.toml +++ b/transports/webrtc-websys/Cargo.toml @@ -26,7 +26,7 @@ send_wrapper = { version = "0.6.0", features = ["futures"] } serde = { version = "1.0", features = ["derive"] } thiserror = "1" tracing = "0.1.37" -wasm-bindgen = { version = "0.2.88" } +wasm-bindgen = { version = "0.2.89" } wasm-bindgen-futures = { version = "0.4.38" } web-sys = { version = "0.3.65", features = ["Document", "Location", "MessageEvent", "Navigator", "RtcCertificate", "RtcConfiguration", "RtcDataChannel", "RtcDataChannelEvent", "RtcDataChannelInit", "RtcDataChannelState", "RtcDataChannelType", "RtcPeerConnection", "RtcSdpType", "RtcSessionDescription", "RtcSessionDescriptionInit", "Window"] } diff --git a/transports/websocket-websys/Cargo.toml b/transports/websocket-websys/Cargo.toml index 8950f8ac1f9..b0493533e26 100644 --- a/transports/websocket-websys/Cargo.toml +++ b/transports/websocket-websys/Cargo.toml @@ -19,7 +19,7 @@ tracing = "0.1.37" parking_lot = "0.12.1" send_wrapper = "0.6.0" thiserror = "1.0.50" -wasm-bindgen = "0.2.88" +wasm-bindgen = "0.2.89" web-sys = { version = "0.3.65", features = ["BinaryType", "CloseEvent", "MessageEvent", "WebSocket", "Window", "WorkerGlobalScope"] } # Passing arguments to the docsrs builder in order to properly document cfg's. diff --git a/transports/webtransport-websys/Cargo.toml b/transports/webtransport-websys/Cargo.toml index 4d2f476f0ba..d21730e42c4 100644 --- a/transports/webtransport-websys/Cargo.toml +++ b/transports/webtransport-websys/Cargo.toml @@ -24,7 +24,7 @@ multihash = { workspace = true } send_wrapper = { version = "0.6.0", features = ["futures"] } thiserror = "1.0.50" tracing = "0.1.37" -wasm-bindgen = "0.2.88" +wasm-bindgen = "0.2.89" wasm-bindgen-futures = "0.4.38" web-sys = { version = "0.3.65", features = [ "ReadableStreamDefaultReader", diff --git a/wasm-tests/webtransport-tests/Cargo.toml b/wasm-tests/webtransport-tests/Cargo.toml index 11d03f654fc..8d775b6c2fb 100644 --- a/wasm-tests/webtransport-tests/Cargo.toml +++ b/wasm-tests/webtransport-tests/Cargo.toml @@ -17,7 +17,7 @@ libp2p-noise = { workspace = true } libp2p-webtransport-websys = { workspace = true } multiaddr = { workspace = true } multihash = { workspace = true } -wasm-bindgen = "0.2.88" +wasm-bindgen = "0.2.89" wasm-bindgen-futures = "0.4.38" wasm-bindgen-test = "0.3.38" web-sys = { version = "0.3.65", features = ["Response", "Window"] }