Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,18 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
run: |
# Release is a draft (release-please-config.json) so `latest` never
# points at it until every asset is attached — avoids a 404 window.
TAG="${{ needs.release-please.outputs.tag_name }}"
if [ -z "$TAG" ]; then
TAG="$(gh release list --limit 1 --json tagName --jq '.[0].tagName')"
# publish_only retry path has no tag_name: pick the newest *draft*
# only (never a published release) and fail fast if none exists.
TAG="$(gh release list --limit 30 --json tagName,isDraft \
--jq 'map(select(.isDraft)) | .[0].tagName // empty')"
if [ -z "$TAG" ]; then
echo "No draft release found to publish." >&2
exit 1
fi
fi
gh release upload "$TAG" \
dist/gddy-*.tar.gz \
Expand All @@ -154,3 +163,5 @@ jobs:
install.sh \
install.ps1 \
--clobber
# Publish only now assets are complete; stays a draft if build fails.
gh release edit "$TAG" --draft=false --latest
3 changes: 2 additions & 1 deletion release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"rust": {
"release-type": "rust",
"component": "gddy",
"include-component-in-tag": false
"include-component-in-tag": false,
"draft": true
}
}
}
Loading