mirror of
https://github.com/dataelement/dsh-desktop.git
synced 2026-09-28 05:23:01 +08:00
fix(release): restore supported summary model (#546)
This commit is contained in:
@@ -50,6 +50,9 @@ on:
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
env:
|
||||
RELEASE_NOTES_MODEL: gpt-5.6-terra
|
||||
|
||||
concurrency:
|
||||
# Platform-only retries have independent artifacts and never publish.
|
||||
group: desktop-release-${{ github.ref }}-${{ inputs.target || 'all' }}
|
||||
@@ -741,16 +744,23 @@ jobs:
|
||||
set -euo pipefail
|
||||
out=.github/release-artifacts/github-release-notes.md
|
||||
if [ -n "${COPILOT_GITHUB_TOKEN:-}" ]; then
|
||||
echo "Generating GitHub release note via Copilot CLI..."
|
||||
echo "Generating GitHub release note via Copilot CLI with $RELEASE_NOTES_MODEL..."
|
||||
npm install -g @github/copilot@latest || true
|
||||
prompt="$(cat .github/release-artifacts/github-release-prompt.txt)"
|
||||
if copilot -p "$prompt" -s --model gpt-5.6-sol --no-ask-user > "$out" 2>/dev/null && \
|
||||
python3 .github/scripts/github_release_notes.py validate --tag "$RELEASE_TAG" --input "$out"; then
|
||||
echo "✅ AI GitHub release note generated and validated."
|
||||
error_log="$(mktemp)"
|
||||
if copilot -p "$prompt" -s --model "$RELEASE_NOTES_MODEL" --no-ask-user > "$out" 2>"$error_log"; then
|
||||
if python3 .github/scripts/github_release_notes.py validate --tag "$RELEASE_TAG" --input "$out"; then
|
||||
echo "✅ AI GitHub release note generated and validated with $RELEASE_NOTES_MODEL."
|
||||
else
|
||||
echo "::warning::Copilot generated a GitHub release note that failed validation; using the deterministic fallback."
|
||||
python3 .github/scripts/github_release_notes.py generate-fallback --tag "$RELEASE_TAG" --output "$out"
|
||||
fi
|
||||
else
|
||||
echo "⚠️ Falling back to the deterministic GitHub release note."
|
||||
echo "::warning::Copilot failed to generate the GitHub release note with $RELEASE_NOTES_MODEL; using the deterministic fallback."
|
||||
sed -n '1,20{s/^/copilot: /;p;}' "$error_log"
|
||||
python3 .github/scripts/github_release_notes.py generate-fallback --tag "$RELEASE_TAG" --output "$out"
|
||||
fi
|
||||
rm -f "$error_log"
|
||||
else
|
||||
echo "MODELS_TOKEN not set; using the deterministic GitHub release note."
|
||||
python3 .github/scripts/github_release_notes.py generate-fallback --tag "$RELEASE_TAG" --output "$out"
|
||||
@@ -878,18 +888,28 @@ jobs:
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if [ -n "${COPILOT_GITHUB_TOKEN:-}" ]; then
|
||||
echo "Generating release notes via Copilot CLI..."
|
||||
echo "Generating release notes via Copilot CLI with $RELEASE_NOTES_MODEL..."
|
||||
npm install -g @github/copilot@latest || true
|
||||
prompt="$(cat .github/release-artifacts/feishu-release-prompt.txt)"
|
||||
if copilot -p "$prompt" -s --model gpt-5.6-sol --no-ask-user > .github/release-artifacts/feishu-release-notes.md 2>/dev/null && \
|
||||
python3 .github/scripts/feishu_release_notes.py validate --tag "$RELEASE_TAG" --input .github/release-artifacts/feishu-release-notes.md; then
|
||||
echo "✅ AI release notes generated and validated."
|
||||
out=.github/release-artifacts/feishu-release-notes.md
|
||||
error_log="$(mktemp)"
|
||||
if copilot -p "$prompt" -s --model "$RELEASE_NOTES_MODEL" --no-ask-user > "$out" 2>"$error_log"; then
|
||||
if python3 .github/scripts/feishu_release_notes.py validate --tag "$RELEASE_TAG" --input "$out"; then
|
||||
echo "✅ AI release notes generated and validated with $RELEASE_NOTES_MODEL."
|
||||
else
|
||||
echo "::warning::Copilot generated release notes that failed validation; using the deterministic fallback."
|
||||
python3 .github/scripts/feishu_release_notes.py generate-fallback \
|
||||
--tag "$RELEASE_TAG" \
|
||||
--output "$out"
|
||||
fi
|
||||
else
|
||||
echo "⚠️ AI generation fell back to deterministic release note generator."
|
||||
echo "::warning::Copilot failed to generate release notes with $RELEASE_NOTES_MODEL; using the deterministic fallback."
|
||||
sed -n '1,20{s/^/copilot: /;p;}' "$error_log"
|
||||
python3 .github/scripts/feishu_release_notes.py generate-fallback \
|
||||
--tag "$RELEASE_TAG" \
|
||||
--output .github/release-artifacts/feishu-release-notes.md
|
||||
--output "$out"
|
||||
fi
|
||||
rm -f "$error_log"
|
||||
else
|
||||
echo "Generating release notes from git evidence..."
|
||||
python3 .github/scripts/feishu_release_notes.py generate-fallback \
|
||||
@@ -1024,19 +1044,30 @@ jobs:
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if [ -n "${COPILOT_GITHUB_TOKEN:-}" ]; then
|
||||
echo "Generating prerelease notes via Copilot CLI..."
|
||||
echo "Generating prerelease notes via Copilot CLI with $RELEASE_NOTES_MODEL..."
|
||||
npm install -g @github/copilot@latest || true
|
||||
prompt="$(cat .github/release-artifacts/feishu-release-prompt.txt)"
|
||||
if copilot -p "$prompt" -s --model gpt-5.6-sol --no-ask-user > .github/release-artifacts/feishu-release-notes.md 2>/dev/null && \
|
||||
python3 .github/scripts/feishu_release_notes.py validate --tag "$RELEASE_TAG" --prerelease --input .github/release-artifacts/feishu-release-notes.md; then
|
||||
echo "✅ AI prerelease notes generated and validated."
|
||||
out=.github/release-artifacts/feishu-release-notes.md
|
||||
error_log="$(mktemp)"
|
||||
if copilot -p "$prompt" -s --model "$RELEASE_NOTES_MODEL" --no-ask-user > "$out" 2>"$error_log"; then
|
||||
if python3 .github/scripts/feishu_release_notes.py validate --tag "$RELEASE_TAG" --prerelease --input "$out"; then
|
||||
echo "✅ AI prerelease notes generated and validated with $RELEASE_NOTES_MODEL."
|
||||
else
|
||||
echo "::warning::Copilot generated prerelease notes that failed validation; using the deterministic fallback."
|
||||
python3 .github/scripts/feishu_release_notes.py generate-fallback \
|
||||
--tag "$RELEASE_TAG" \
|
||||
--prerelease \
|
||||
--output "$out"
|
||||
fi
|
||||
else
|
||||
echo "⚠️ AI generation fell back to deterministic release note generator."
|
||||
echo "::warning::Copilot failed to generate prerelease notes with $RELEASE_NOTES_MODEL; using the deterministic fallback."
|
||||
sed -n '1,20{s/^/copilot: /;p;}' "$error_log"
|
||||
python3 .github/scripts/feishu_release_notes.py generate-fallback \
|
||||
--tag "$RELEASE_TAG" \
|
||||
--prerelease \
|
||||
--output .github/release-artifacts/feishu-release-notes.md
|
||||
--output "$out"
|
||||
fi
|
||||
rm -f "$error_log"
|
||||
else
|
||||
echo "Generating prerelease notes from git evidence..."
|
||||
python3 .github/scripts/feishu_release_notes.py generate-fallback \
|
||||
|
||||
@@ -593,6 +593,16 @@ describe('AI-organized GitHub release body', () => {
|
||||
expect(publishJob).toContain('github-release-notes.md')
|
||||
})
|
||||
|
||||
it('uses an available Copilot model and keeps generation failures diagnosable', async () => {
|
||||
const yml = await load()
|
||||
expect(yml).toContain('RELEASE_NOTES_MODEL: gpt-5.6-terra')
|
||||
expect(yml).not.toContain('gpt-5.6-sol')
|
||||
expect(yml.match(/--model "\$RELEASE_NOTES_MODEL"/g)).toHaveLength(3)
|
||||
expect(yml.match(/2>"\$error_log"/g)).toHaveLength(3)
|
||||
expect(yml).not.toContain('2>/dev/null')
|
||||
expect(yml.match(/sed -n '1,20\{s\/\^\/copilot: \/;p;\}'/g)).toHaveLength(3)
|
||||
})
|
||||
|
||||
it('still lets the prerelease job use --generate-notes', async () => {
|
||||
const yml = await load()
|
||||
const preJob = yml.slice(yml.indexOf('\n publish-prerelease:'))
|
||||
|
||||
Reference in New Issue
Block a user