From 61017085652f3068b80621cba97305b894bc5c60 Mon Sep 17 00:00:00 2001 From: chad Date: Sat, 17 Sep 2022 16:05:34 -0500 Subject: [PATCH 1/2] .github/: Enforce semantic versioning using cargo-semver-checks (#2635) --- .github/workflows/ci.yml | 45 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 83bad9cfdc6..dae8ffa0990 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -210,7 +210,52 @@ jobs: ALL_FEATURES=$(cargo metadata --format-version=1 --no-deps | jq -r '.packages[] | select(.name == "libp2p") | .features | keys | map(select(. != "full")) | sort | join(" ")') FULL_FEATURE=$(cargo metadata --format-version=1 --no-deps | jq -r '.packages[] | select(.name == "libp2p") | .features["full"] | sort | join(" ")') + test "$ALL_FEATURES = $FULL_FEATURE" + echo "$ALL_FEATURES"; echo "$FULL_FEATURE"; test "$ALL_FEATURES" = "$FULL_FEATURE" + + gather_crates_for_semver_checks: + runs-on: ubuntu-latest + outputs: + members: ${{ steps.cargo-metadata.outputs.members }} + steps: + - uses: actions/checkout@v3 + + - id: cargo-metadata + run: | + WORKSPACE_MEMBERS=$(cargo metadata --format-version=1 --no-deps | jq -c '.packages | .[] | select(.publish == null) | .name' | jq -s '.' | jq -c '.') + echo "::set-output name=members::${WORKSPACE_MEMBERS}" + + semver-check: + runs-on: ubuntu-latest + needs: gather_crates_for_semver_checks + strategy: + fail-fast: false + matrix: + crate: ${{ fromJSON(needs.gather_crates_for_semver_checks.outputs.members) }} + steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@bb6001c4ea612bf59c3abfc4756fbceee4f870c7 # 0.10.0 + with: + access_token: ${{ github.token }} + + - uses: actions/checkout@v3 + + - uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7 + with: + profile: minimal + toolchain: stable + override: true + + - name: Install Protoc + uses: arduino/setup-protoc@v1 + + - uses: Swatinem/rust-cache@6720f05bc48b77f96918929a9019fb2203ff71f8 # v2.0.0 + + - run: cargo install cargo-semver-checks + + - name: Semver Check + run: cargo semver-checks check-release -p ${{ matrix.crate }} From 42fc37c2a6ae42823221c42b2f5c44c2c1bf0174 Mon Sep 17 00:00:00 2001 From: chad Date: Mon, 10 Oct 2022 12:28:13 -0500 Subject: [PATCH 2/2] misc/keygen: set publish to false in Cargo.toml since this is a private package (#2635) --- misc/keygen/Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/misc/keygen/Cargo.toml b/misc/keygen/Cargo.toml index 13b1ff38216..6aaf01fbc4e 100644 --- a/misc/keygen/Cargo.toml +++ b/misc/keygen/Cargo.toml @@ -7,6 +7,7 @@ license = "MIT" repository = "https://github.com/libp2p/rust-libp2p" keywords = ["peer-to-peer", "libp2p", "networking"] categories = ["network-programming", "asynchronous"] +publish = false [dependencies] clap = {version = "3.1.6", features = ["derive"]}