Skip to content

Commit 58ba58a

Browse files
committed
chore: fix crate release detection
1 parent 487d918 commit 58ba58a

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

.github/release-crates-check.sh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,15 @@ publish_list=""
2626
while IFS=$'\t' read -r name version manifest_path; do
2727
echo "checking $name@$version (manifest: $manifest_path) ..."
2828

29-
STATUS_CODE=$(curl -s -o /dev/null -w "%{http_code}" "https://crates.io/api/v1/crates/$name/$version")
29+
cargo info "$name@$version" --registry crates-io &> /dev/null
30+
EXIT_CODE=$?
3031

31-
if [ "$STATUS_CODE" -eq 200 ]; then
32-
echo " [x] ALREADY PUBLISHED"
33-
elif [ "$STATUS_CODE" -eq 404 ]; then
32+
if [ "$EXIT_CODE" -eq 0 ]; then
33+
echo " ALREADY PUBLISHED"
34+
else
3435
echo " [ ] NOT PUBLISHED"
3536
dir_name=$(dirname "$manifest_path")
3637
publish_list="${publish_list}${name}\t${dir_name}\n"
37-
else
38-
echo " ❌ ERROR (Received HTTP $STATUS_CODE)" >&2
3938
fi
4039
echo "---"
4140
done <<< "$CRATES_TO_CHECK"

.github/workflows/release-crates.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ jobs:
4343
uses: rust-lang/crates-io-auth-action@v1
4444
id: auth
4545

46+
- name: publish config lib
47+
if: env.CRATES_TO_PUBLISH.hive-router-config
48+
env:
49+
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
50+
run: |
51+
cargo publish --manifest-path ${{ env.CRATES_TO_PUBLISH.hive-router-config }}
52+
4653
- name: publish query-planner lib
4754
if: env.CRATES_TO_PUBLISH.hive-router-query-planner
4855
env:

0 commit comments

Comments
 (0)