Skip to content

Commit e9cb409

Browse files
authored
Disable docs build verification in CI for non-lib crates (payjoin#1799)
2 parents aa48553 + d051171 commit e9cb409

2 files changed

Lines changed: 15 additions & 6 deletions

File tree

.github/workflows/crates-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ jobs:
199199
- name: Use nix cache
200200
uses: DeterminateSystems/magic-nix-cache-action@main
201201
- name: Download packaged crate
202-
uses: actions/download-artifact@v4
202+
uses: actions/download-artifact@v8
203203
with:
204204
name: crate
205205
path: dist

contrib/release/verify-published.sh

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,17 @@ published_sha="$(poll "${CRATES_IO_ATTEMPTS:-30}" \
4545
die "checksum mismatch: crates.io $published_sha vs local $local_sha"
4646
echo "crates.io checksum matches the attested .crate ($local_sha)"
4747

48-
echo "Waiting for docs.rs to build $crate $version (${DOCS_RS_ATTEMPTS:-60} checks, ${interval}s apart)"
49-
poll "${DOCS_RS_ATTEMPTS:-60}" \
50-
"https://docs.rs/crate/$crate/$version/status.json" 'select(.doc_status == true) | "built"' >/dev/null ||
51-
die "docs.rs did not build $crate $version"
52-
echo "docs.rs built $crate $version"
48+
# docs.rs builds documentation only for crates with a library target;
49+
# binary-only crates (e.g. payjoin-cli) never reach doc_status == true.
50+
if cargo metadata --format-version 1 --no-deps 2>/dev/null |
51+
jq -e --arg c "$crate" \
52+
'any(.packages[] | select(.name == $c) | .targets[].kind[]; . | test("^(lib|rlib|dylib|cdylib|staticlib|proc-macro)$"))' \
53+
>/dev/null; then
54+
echo "Waiting for docs.rs to build $crate $version (${DOCS_RS_ATTEMPTS:-60} checks, ${interval}s apart)"
55+
poll "${DOCS_RS_ATTEMPTS:-60}" \
56+
"https://docs.rs/crate/$crate/$version/status.json" 'select(.doc_status == true) | "built"' >/dev/null ||
57+
die "docs.rs did not build $crate $version"
58+
echo "docs.rs built $crate $version"
59+
else
60+
echo "Skipping docs.rs check for $crate (no library target)"
61+
fi

0 commit comments

Comments
 (0)