Skip to content

Commit 8aa61ac

Browse files
committed
fix(release): Update cargo-dist plan command for new API - The dist host command no longer accepts a ref argument in newer cargo-dist versions
Made-with: Cursor
1 parent 0b7f0aa commit 8aa61ac

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

.github/workflows/release.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,24 +54,25 @@ jobs:
5454
run: |
5555
# Use the provided tag for workflow_dispatch, or github.ref for push
5656
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
57-
REF="refs/tags/${{ github.event.inputs.tag }}"
57+
TAG="${{ github.event.inputs.tag }}"
5858
else
59-
REF="${{ github.ref }}"
59+
TAG="${{ github.ref_name }}"
6060
fi
6161
62-
dist host --steps=upload --steps=release --output-format=json "$REF" > dist-manifest.json || true
62+
# Try cargo-dist plan (newer API) - doesn't take ref argument anymore
63+
dist plan --output-format=json > dist-manifest.json 2>/dev/null || true
6364
64-
# If cargo-dist plan fails, we'll still proceed with manual build
65-
if [ -f dist-manifest.json ]; then
65+
# If cargo-dist plan fails or produces empty output, fallback to manual values
66+
if [ -f dist-manifest.json ] && [ -s dist-manifest.json ] && jq -e '.releases' dist-manifest.json >/dev/null 2>&1; then
6667
echo "dist-manifest.json:"
6768
cat dist-manifest.json
6869
DIST_TAG=$(jq -r '.announcement_tag // empty' dist-manifest.json)
6970
DIST_VERSION=$(jq -r '.announcement_title // empty' dist-manifest.json)
7071
HAS_RELEASES=$(jq '.releases | length' dist-manifest.json 2>/dev/null || echo "0")
7172
else
72-
# Extract tag from REF
73-
DIST_TAG="${REF#refs/tags/}"
74-
DIST_VERSION="${DIST_TAG}"
73+
# Fallback: use tag directly
74+
DIST_TAG="$TAG"
75+
DIST_VERSION="$TAG"
7576
HAS_RELEASES="1"
7677
fi
7778

0 commit comments

Comments
 (0)