From 2f668423776a8c42043d356eeb97839afddd2839 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20V=C3=A9ril?= Date: Thu, 12 Nov 2026 18:36:29 +0100 Subject: [PATCH 1/2] Fix crates.io API requests with a descriptive User-Agent --- .github/workflows/publish-crates.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-crates.yml b/.github/workflows/publish-crates.yml index 7027ecea..33e06942 100644 --- a/.github/workflows/publish-crates.yml +++ b/.github/workflows/publish-crates.yml @@ -63,7 +63,10 @@ jobs: excluded=() for package in rustiq-chem-core rustiq-chem; do - status=$(curl --silent --show-error --output "${package}.json" \ + status=$(curl --silent --show-error \ + --user-agent "RustiQ-release-check (https://github.com/mveril/RustiQ)" \ + --header "Accept: application/json" \ + --output "${package}.json" \ --write-out '%{http_code}' \ "https://crates.io/api/v1/crates/${package}/${version}") case "$status" in From d56546f3812fb27c9b2c146ee70b780f96d0fe63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20V=C3=A9ril?= Date: Thu, 12 Nov 2026 18:37:59 +0100 Subject: [PATCH 2/2] Keep publication checks outside the release source tree --- .github/workflows/publish-crates.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish-crates.yml b/.github/workflows/publish-crates.yml index 33e06942..4e0e0e71 100644 --- a/.github/workflows/publish-crates.yml +++ b/.github/workflows/publish-crates.yml @@ -49,7 +49,9 @@ jobs: exit 1 fi version="${RELEASE_TAG#v}" - cargo metadata --locked --format-version 1 --no-deps > metadata.json + check_dir=$(mktemp -d) + trap 'rm -rf "$check_dir"' EXIT + cargo metadata --locked --format-version 1 --no-deps > "$check_dir/metadata.json" jq --exit-status --arg version "$version" ' [.packages[] | select(.name == "rustiq-chem")] as $cli | [.packages[] | select(.name == "rustiq-chem-core")] as $core @@ -59,20 +61,20 @@ jobs: and $core[0].version == $version and any($cli[0].dependencies[]; .name == "rustiq-chem-core" and .req == ("^" + $version)) - ' metadata.json + ' "$check_dir/metadata.json" excluded=() for package in rustiq-chem-core rustiq-chem; do status=$(curl --silent --show-error \ --user-agent "RustiQ-release-check (https://github.com/mveril/RustiQ)" \ --header "Accept: application/json" \ - --output "${package}.json" \ + --output "$check_dir/${package}.json" \ --write-out '%{http_code}' \ "https://crates.io/api/v1/crates/${package}/${version}") case "$status" in 200) jq --exit-status --arg version "$version" \ - '.version.num == $version' "${package}.json" >/dev/null + '.version.num == $version' "$check_dir/${package}.json" >/dev/null excluded+=("$package") echo "$package $version is already published; it will be skipped." ;;