fix(workflows): standardize release notes generation and add prerelease labels

- Fix release-sdk.yml: Use file-based approach with --notes-file instead of
  complex inline string interpolation to avoid shell parsing errors with
  backticks and special characters

- Fix release.yml: Add --prerelease flag for nightly and preview releases
to properly mark them as pre-releases on GitHub

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
mingholy.lmh 2026-02-20 21:57:53 +08:00
parent c6a723efef
commit 8fe304c19b
2 changed files with 32 additions and 5 deletions

View file

@ -348,15 +348,33 @@ jobs:
CLI_SOURCE_DESC="CLI built from source (same branch/ref as SDK)"
fi
# Create release notes with CLI version info
NOTES="## Bundled CLI Version\n\nThis SDK release bundles CLI version: \`${CLI_VERSION}\`\n\nSource: ${CLI_SOURCE_DESC}\n\n---\n\n"
# Create release notes file
NOTES_FILE=$(mktemp)
{
echo "## Bundled CLI Version"
echo ""
echo "This SDK release bundles CLI version: ${CLI_VERSION}"
echo ""
echo "Source: ${CLI_SOURCE_DESC}"
echo ""
echo "---"
echo ""
} > "${NOTES_FILE}"
# Get previous release notes if available
PREVIOUS_NOTES=$(gh release view "sdk-typescript-${PREVIOUS_RELEASE_TAG}" --json body -q '.body' 2>/dev/null || echo 'See commit history for changes.')
echo "${PREVIOUS_NOTES}" >> "${NOTES_FILE}"
# Create GitHub release
gh release create "sdk-typescript-${RELEASE_TAG}" \
--target "${TARGET}" \
--title "SDK TypeScript Release ${RELEASE_TAG}" \
--notes-start-tag "sdk-typescript-${PREVIOUS_RELEASE_TAG}" \
--notes "${NOTES}$(gh release view "sdk-typescript-${PREVIOUS_RELEASE_TAG}" --json body -q '.body' 2>/dev/null || echo 'See commit history for changes.')" \
"${PRERELEASE_FLAG}"
--notes-file "${NOTES_FILE}" \
${PRERELEASE_FLAG}
# Cleanup
rm -f "${NOTES_FILE}"
- name: 'Create PR to merge release branch into main'
if: |-