mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-09-30 12:39:42 +02:00
ci(release): pin the Latest badge to the Codeman release
The workspace publishes two packages, changesets creates a GitHub release for each, and GitHub awards "Latest" to whichever was published last. That is a race: 1.9.2 kept the badge, 1.9.4 lost it to xterm-zerolag-input@0.1.7 by two seconds. Set make_latest in the rename PATCH, which runs after every package release already exists. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -52,12 +52,20 @@ jobs:
|
|||||||
OLD_TAG="aicodeman@${VERSION}"
|
OLD_TAG="aicodeman@${VERSION}"
|
||||||
NEW_TAG="codeman@${VERSION}"
|
NEW_TAG="codeman@${VERSION}"
|
||||||
|
|
||||||
# Update the GitHub release BEFORE deleting the old tag
|
# Update the GitHub release BEFORE deleting the old tag.
|
||||||
|
# make_latest pins the "Latest" badge to the Codeman release. This repo
|
||||||
|
# publishes TWO packages (aicodeman + xterm-zerolag-input), changesets
|
||||||
|
# creates a GitHub release for each, and GitHub awards "Latest" to
|
||||||
|
# whichever was published LAST. That is a race: 1.9.2 kept the badge,
|
||||||
|
# 1.9.4 lost it to xterm-zerolag-input@0.1.7 by two seconds. All package
|
||||||
|
# releases already exist by the time this step runs, so setting it here
|
||||||
|
# is deterministic.
|
||||||
RELEASE_ID=$(gh release view "$OLD_TAG" --json databaseId -q .databaseId 2>/dev/null || true)
|
RELEASE_ID=$(gh release view "$OLD_TAG" --json databaseId -q .databaseId 2>/dev/null || true)
|
||||||
if [ -n "$RELEASE_ID" ]; then
|
if [ -n "$RELEASE_ID" ]; then
|
||||||
gh api -X PATCH "repos/${{ github.repository }}/releases/${RELEASE_ID}" \
|
gh api -X PATCH "repos/${{ github.repository }}/releases/${RELEASE_ID}" \
|
||||||
-f tag_name="$NEW_TAG" \
|
-f tag_name="$NEW_TAG" \
|
||||||
-f name="$NEW_TAG"
|
-f name="$NEW_TAG" \
|
||||||
|
-f make_latest=true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Retag
|
# Retag
|
||||||
|
|||||||
Reference in New Issue
Block a user