Skip to content

Commit b810bd8

Browse files
committed
switch to index
1 parent b7f3861 commit b810bd8

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

ci/semver.sh

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ set -euxo pipefail
66
# https://crates.io/data-access#api
77

88
# Need to include versions to get the default and stable versions
9-
meta=$(curl -L https://crates.io/api/v1/crates/libc?include=versions)
10-
11-
echo "$meta" | jq -r '.versions | map(select(.num | test("^0.2"))).[0].dl_path'
9+
meta=$(curl -L https://index.crates.io/li/bc/libc)
1210

1311
# Versions to check against
1412
if [ "${SERIES:-}" = "0.2" ]; then
@@ -23,13 +21,12 @@ fi
2321
# Find the most recent version matching a pattern.
2422
release=$(
2523
echo "$meta" |
26-
jq -er --arg pat "$pat" '.versions | map(select(.num | test($pat))).[0]'
24+
jq -er --slurp --arg pat "$pat" 'map(select(.vers | test($pat))) | last'
2725
)
28-
version=$(echo "$release" | jq -r '.num')
29-
dl_path=$(echo "$release" | jq -r '.dl_path')
26+
version=$(echo "$release" | jq -r '.vers')
3027

3128
crate_dir="libc-$version"
32-
curl -L "https://crates.io$dl_path" | tar xf -
29+
curl -L "https://static.crates.io/crates/libc/libc-$version.crate" | tar xf -
3330

3431
# Need to convince Cargo it's not part of our workspace
3532
echo '[workspace]' >> "$crate_dir/Cargo.toml"

0 commit comments

Comments
 (0)