Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# Creates a draft GitHub release when azure-cli.version changes.
# vars.RELEASE=PRERELEASE (default) → tag/title {version}-preview, draft --prerelease.
# vars.RELEASE=STABLE → tag/title {version}, draft (not a prerelease). Never edits an existing preview.
# Org webhook publishes drafts.
# Org webhook publishes drafts. Always append <!-- !X --> and <!-- nosponsors -->
# so SponsorLink does not post to X or inject a sponsors section: the notes are
# Upstream Azure CLI notes, not ours. <!-- X --> is the opposite (force-announce)
# and must not appear.
name: release
on:
push:
Expand Down Expand Up @@ -43,7 +46,8 @@ jobs:
printf '%s\n' "$BODY"
echo ""
echo "https://github.com/Azure/azure-cli/releases/tag/azure-cli-$VERSION"
echo "<!-- X -->"
echo "<!-- !X -->"
echo "<!-- nosponsors -->"
} > release-notes.md

if gh release view "$TAG" >/dev/null 2>&1; then
Expand Down
3 changes: 3 additions & 0 deletions docs/adr/0004-releases-skip-x-announcements.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Releases skip SponsorLink announcements and sponsor injection

Draft notes copy the Upstream Azure CLI release body. SponsorLink's org webhook posts a published release to X unless the body contains `<!-- !X -->`, and injects a sponsors section unless it contains `<!-- nosponsors -->`. We always append both: the notes are Azure's work, not ours. `<!-- X -->` is the opposite (force-announce) and must not appear.
9 changes: 9 additions & 0 deletions src/Tests/ReleaseTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ public void Non_stable_release_is_named_version_preview_not_an_edit()
Assert.DoesNotContain("--prerelease=false", release);
}

[Fact]
public void Draft_notes_opt_out_of_sponsorlink_side_effects()
{
var release = File.ReadAllText(Path.Combine(FindRepoRoot(), ".github", "workflows", "release.yml"));
Assert.Contains("echo \"<!-- !X -->\"", release);
Assert.DoesNotContain("echo \"<!-- X -->\"", release);
Assert.Contains("echo \"<!-- nosponsors -->\"", release);
}

[Fact]
public void Publish_version_does_not_double_append_preview()
{
Expand Down
Loading