| name | github-release |
| description | Publish x-gateway artifacts to GitHub Releases using gh CLI with tag/version validation and idempotent retry behavior. |
| allowed-tools | Bash, Read, Write, Grep, Glob |
| user-invocable | true |
| argument-hint | ["version or tag"] |
GitHub Release Skill
Use this skill to create or update GitHub Releases for x-gateway.
Preconditions
- GitHub auth is valid:
gh auth status
- Working tree is clean for release operations:
git status --short
- Version is resolved from
VERSION unless user explicitly sets tag:
VERSION=$(tr -d '[:space:]' < VERSION)
TAG="v${VERSION}"
Required Artifacts
Expected assets for release upload:
dist/homebrew/x-gateway-<version>-darwin-arm64.tar.gz
dist/homebrew/x-gateway-<version>-darwin-x64.tar.gz
dist/homebrew/x-gateway-<version>-darwin-arm64.tar.gz.sha256
dist/homebrew/x-gateway-<version>-darwin-x64.tar.gz.sha256
If artifacts are missing, invoke binary-release first.
Standard Commands
- Ensure tag exists (create if missing):
if git rev-parse "$TAG" >/dev/null 2>&1; then
echo "Tag $TAG already exists"
else
git tag -a "$TAG" -m "Release $TAG"
git push origin "$TAG"
fi
- Create GitHub release when absent:
gh release view "$TAG" >/dev/null 2>&1 || \
gh release create "$TAG" \
--title "x-gateway $TAG" \
--generate-notes
- Upload or overwrite assets:
gh release upload "$TAG" dist/homebrew/x-gateway-"$VERSION"-darwin-*.tar.gz* --clobber
Verification
- Confirm release page:
gh release view "$TAG" --json url --jq '.url'
- Confirm tag target commit:
git rev-list -n 1 "$TAG"
- Confirm all required asset names are present:
gh release view "$TAG" --json assets --jq '.assets[].name'
Failure Handling
- If
gh release create fails due to existing release, switch to upload-only mode.
- If tag points to wrong commit, stop and ask whether retagging is authorized.
- If partial upload fails, re-run
gh release upload ... --clobber for missing files.