diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6b0fb2e0f..4cba851fa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -367,10 +367,15 @@ jobs: TAG: ${{ needs.decide.outputs.tag }} run: | signature=(); [[ -f dist/SHA256SUMS.sig ]] && signature=(dist/SHA256SUMS.sig) - # The release and the latest at once: there is one channel (docs/release-flow.md). + # The release and the latest at once: there is one channel (docs/release-flow.md). Each archive gets a + # label (file#label), which GitHub's page shows instead of the file name, so nobody takes the game's + # files for the download (#1647). Launchers, servers and install.sh match the name, which stays. gh release create "$TAG" --target "${{ needs.decide.outputs.head }}" --title "$(cat notes/title.txt)" \ - --notes-file notes/body.md --latest dist/horizon-linux-x86_64.tar.gz \ - dist/horizon-windows-x64.zip dist/horizon-macos-arm64.zip dist/horizon-server-linux-x86_64.tar.gz \ + --notes-file notes/body.md --latest \ + "dist/horizon-linux-x86_64.tar.gz#Game files the launcher installs: Linux (horizon-linux-x86_64.tar.gz)" \ + "dist/horizon-windows-x64.zip#Game files the launcher installs: Windows (horizon-windows-x64.zip)" \ + "dist/horizon-macos-arm64.zip#Game files the launcher installs: macOS (horizon-macos-arm64.zip)" \ + "dist/horizon-server-linux-x86_64.tar.gz#Dedicated server for Linux (horizon-server-linux-x86_64.tar.gz)" \ dist/SHA256SUMS "${signature[@]}" dist/smoke-test.json - name: Dry run, the release that would be published if: needs.decide.outputs.dry_run == 'true' diff --git a/docs/release-flow.md b/docs/release-flow.md index 758f254ee..4fb0209d9 100644 --- a/docs/release-flow.md +++ b/docs/release-flow.md @@ -312,6 +312,15 @@ and by hand; pushes to `launcher` and `launcher-*` branches only build. - Published with `--latest=false`: the repository's latest release stays a game release. Notes list the pull requests under New and Fixed; Kira posts launcher releases without pinging. +Making a launcher release GitHub's latest instead would break servers: every `horizon-server` already installed, +`install.sh` and `install.ps1` ask for `releases/latest` and expect the game's archives there, and a server that +can't update can't fetch the fix either. So the game release stays the latest, and it sends people to the launcher +(#1647): its notes open with a "Want to play? Download the Horizon launcher" block (`PLAYERS` in +`tools/release_train.py`: raw HTML, which GitHub shows and launchers' notes skip; the site's Releases page leaves +it out too), and its archives carry labels ("Game files the +launcher installs: Linux (…)") that GitHub shows in place of the file names. Everything that downloads matches +the asset's name, which is unchanged. + Starting by hand, pausing and rolling back work as for the game (`gh workflow run launcher …`, `RELEASES_PAUSED`, `gh release edit launcher@X.Y.Z --draft`). Launchers older than the withdrawn release then see the previous one as the newest; launchers that already updated keep running. diff --git a/tests/test_release_train.py b/tests/test_release_train.py index dde734c7d..56064fa42 100644 --- a/tests/test_release_train.py +++ b/tests/test_release_train.py @@ -106,16 +106,18 @@ class ReleaseTrainTests(unittest.TestCase): def test_the_first_release_of_0_2_says_what_changed(self): title, body = train.notes("game", "v0.2.0", [pr(1)], [], previous="v2026.10.21") self.assertTrue(title.startswith("Horizon 0.2.0: "), title) + body = body.removeprefix(train.PLAYERS + "\n\n") self.assertTrue(body.startswith("Horizon is numbered from now on: this is Horizon 0.2.0, the release after 2026.10.21.")) self.assertIn("`horizon-server update --version v0.2.0`", body) title, body = train.notes("launcher", "launcher@0.2.0", [], [], previous="launcher-v0.17.0") self.assertEqual(title, "Horizon launcher 0.2.0") self.assertIn("the release after launcher 0.17.0", body) self.assertIn("Rebuilt from the latest main.", body) - self.assertTrue(train.notes("game", "v0.3.0", [pr(1)], [], previous="v0.2.14")[1].startswith("The first release of Horizon 0.3.")) + body = train.notes("game", "v0.3.0", [pr(1)], [], previous="v0.2.14")[1] + self.assertTrue(body.startswith(train.PLAYERS + "\n\nThe first release of Horizon 0.3.")) for version, previous in [("v0.2.1", "v0.2.0"), ("v0.3.0-rc.1", "v0.2.9"), ("v2026.10.23", "v2026.10.21")]: body = train.notes("game", version, [pr(1)], [], previous=previous)[1] - self.assertTrue(body.startswith("### Fixed"), (version, body)) + self.assertTrue(body.startswith(train.PLAYERS + "\n\n### Fixed"), (version, body)) def test_decision(self): minute = dt.timedelta(minutes=1) @@ -201,6 +203,18 @@ class ReleaseTrainTests(unittest.TestCase): self.assertEqual(title, "Horizon launcher 0.2.0") self.assertIn("### Fixed\n- Launcher: say the self-update succeeded (#3)", body) self.assertNotIn("Known issues", body) + self.assertNotIn(train.PLAYERS, body) + self.assertIn("Your launcher updates itself.", body) + + def test_a_game_release_opens_with_the_way_to_the_launcher(self): + # GitHub's latest is a game release: whoever lands on it is sent to the launcher first (#1647). + _, body = train.notes("game", "v0.2.50", [pr(1)], ["- Sound cuts out after an hour."]) + self.assertTrue(body.startswith('
It installs this version and keeps it up to date. It is also on GitHub: the launcher releases. You need your ' + "own copy of Minecraft: Java Edition. The files below are what the launcher installs, and the dedicated " + "server for people who host one.
") +LAUNCHER_FOOTER = ("Your launcher updates itself. New here? Download the archive for your system below, extract it, " + "and run `horizon-launcher`. Website: https://playhorizon.dev") DISCLAIMER = "Not an official Minecraft product. Not approved by or associated with Mojang or Microsoft." # An open issue with this label holds every game release (docs/release-flow.md). Only people who can triage the # repository can add it, and the issue's text is never read: its author could edit it afterwards. @@ -374,7 +379,9 @@ def notes(kind, version, prs, issues, previous=None): else: title = f"Horizon launcher {version.removeprefix(OLD_LAUNCHER_PREFIX).removeprefix(LAUNCHER_PREFIX)}" intro = line_intro(kind, version, previous) - parts = [intro] if intro else [] + parts = [PLAYERS] if kind == "game" else [] + if intro: + parts.append(intro) if not shown: parts.append("Rebuilt from the latest main.") if new: @@ -386,7 +393,8 @@ def notes(kind, version, prs, issues, previous=None): contributors = sorted({pr["author"] for pr in shown if pr["author"] and pr["author"] != REPO.split("/")[0]}) if contributors: parts.append("Thanks to " + ", ".join(f"@{name}" for name in contributors) + ".") - parts.append(FOOTER[kind]) + if kind == "launcher": + parts.append(LAUNCHER_FOOTER) parts.append(DISCLAIMER) return title, "\n\n".join(parts) + "\n" diff --git a/website/src/releases.js b/website/src/releases.js index de59c8fef..d4932e7f7 100644 --- a/website/src/releases.js +++ b/website/src/releases.js @@ -50,8 +50,12 @@ export function sections(body) { // An item without its pull request references: "Riptide (#123, fixes #45)" -> "Riptide". export const plainItem = (item) => item.replace(/\s*\((?:#\d+|fixes #\d+|[^()]*#\d+[^()]*)\)\s*/g, " ").replace(/\s+/g, " ").trim(); +// A game release's notes open with an HTML block sending people to the launcher (PLAYERS in tools/release_train.py): +// GitHub's latest release is the game's. This site has its own download button, so it leaves the block out. +export const notesText = (body) => (body || "").replace(/^${escape(o.text)}
` : ""} ${top.length ? `No notes for this release.
"}No notes for this release.
"}Downloads
It installs this version.
'; + +test("the block sending people to the launcher is left out, the notes stay", () => { + assert.equal(notesText(`${players}\n\n### Fixed\n- A fix (#1)\n`), "### Fixed\n- A fix (#1)\n"); + assert.equal(notesText(`${players}\r\n\r\nRebuilt from the latest main.\r\n`), "Rebuilt from the latest main.\r\n"); + assert.equal(notesText("Other HTML
\n\n### New\n- A thing (#2)\n"), "Other HTML
\n\n### New\n- A thing (#2)\n"); + assert.equal(notesText(undefined), ""); +});