fix(pack): valid manifest YAML, stable-release picker, tolerant asset re-upload
- manifest: single-quote the coa-template note - nested double quotes made the scalar invalid YAML (awk include-parser unaffected; it only reads repo:/include: lines) - build_pack: releases?limit=1 could hand back a prerelease/draft; fetch limit=10 and jq-select the first stable release - release.yml: re-running for an existing tag 409'd on duplicate asset names and set -euo pipefail killed the job; skip already-attached assets / warn on failed uploads and only fail when the release ends up with zero assets
This commit is contained in:
parent
ec25b5d022
commit
9154d56750
3 changed files with 30 additions and 10 deletions
|
|
@ -78,13 +78,14 @@ manifest_includes() {
|
|||
' "$MANIFEST"
|
||||
}
|
||||
|
||||
# Latest release JSON for a repo, or empty string if none.
|
||||
# Latest stable release JSON for a repo, or empty string if none.
|
||||
latest_release_json() {
|
||||
local repo="$1" json
|
||||
json="$(curl -fsS "$API/repos/$ORG/$repo/releases?limit=1" 2>/dev/null || echo '[]')"
|
||||
# `releases?limit=1` returns an array. Strip the wrapper.
|
||||
json="$(curl -fsS "$API/repos/$ORG/$repo/releases?limit=10" 2>/dev/null || echo '[]')"
|
||||
# `releases?limit=N` returns a newest-first array that can contain
|
||||
# prereleases/drafts - pick the first stable release.
|
||||
if [ "$(printf '%s' "$json" | jq -r 'type')" = "array" ]; then
|
||||
printf '%s' "$json" | jq -c '.[0] // empty'
|
||||
printf '%s' "$json" | jq -c '[.[] | select(.prerelease == false and .draft == false)][0] // empty'
|
||||
else
|
||||
printf ''
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue