fix(ci): drop invalid platform version and allow re-publishing a release - #278
Merged
Conversation
Publishing 2.9.0 failed: > Task :publishAntiRedstoneClock-RemasteredPublicationToHangar FAILED > Error uploading version, returned 400: Invalid version: 26.0 26.0 is not a Minecraft version that ever shipped. Hangar and Modrinth both reject it; every other entry in supportedMinecraftVersions is valid on both. Checked against the live platform lists: hangar /api/v1/platforms/PAPER/versions -> 26.1, 26.1.1, 26.1.2, 26.2 modrinth /v2/tag/game_version -> same, no 26.0 Because Hangar was published before anything else, the failure also took out Modrinth, the SBOM upload, and the JAR upload - the v2.9.0 GitHub release currently has no assets at all. Two changes so a rejected platform version cannot cost the whole release again: - The JAR is uploaded to the GitHub release before the platform uploads. Hangar and Modrinth reject versions for reasons outside this repository's control; the artifact should survive that. - The workflow can be dispatched manually for an existing tag. Until now a publish that failed after tagging was unrecoverable, because the publish job only runs when release-please creates a release. The `ref` input allows building from main when the tagged commit is what broke publishing, and a guard refuses to publish when the tag and the version in build.gradle.kts disagree.
Contributor
Unit Test Results 8 files 8 suites 1s ⏱️ Results for commit 4df07e1. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The 2.9.0 release is currently broken. This fixes the cause and adds the missing way to recover.
What happened
26.0is not a Minecraft version that ever shipped, and both platforms reject it. Checked against the live lists rather than guessed:hangar.papermc.io/api/v1/platforms/PAPER/versionsapi.modrinth.com/v2/tag/game_versionEvery other entry in
supportedMinecraftVersionsis valid on both.26.0is the only bad one.The damage is wider than Hangar
The publish step ran
./gradlew check shadowJar publishAllPublicationsToHangar modrinth cyclonedxBomas a single command, with Hangar first. When Hangar rejected the version, everything after it never ran:v2.9.0v2.9.0And there was no way back: the
publishjob only runs when release-please creates a release, so once the tag existed, a failed publish was unrecoverable without cutting a throwaway version.Changes
1.
26.0removed fromsupportedMinecraftVersions. Also removes therun-26.0/run-folia-26.0tasks, which could never have worked either — Paper has no such build.2. The JAR is uploaded to the GitHub release before the platform uploads. Hangar and Modrinth reject versions for reasons outside this repository's control. When that happens the artifact should still land on the release instead of dying with the run.
3. The workflow accepts
workflow_dispatch, so an already-tagged release can be published again:tag(required) — the release tag to publish, e.g.v2.9.0ref(optional) — what to build from, defaults to the tag. Point it atmainwhen the tagged commit is exactly what broke publishing, which is the case here.A guard compares the tag against
versioninbuild.gradle.ktsand refuses to publish if they disagree, sorefcannot be used to accidentally ship 2.9.1 code under the v2.9.0 tag. Verified both directions:release-pleaseis now gated ongithub.event_name == 'push'so a manual dispatch does not touch the release PR, andpublishusesalways()so it is not skipped along with it.Recovering 2.9.0 after this merges
mainstill declaresversion = "2.9.0", so building frommainproduces exactly the 2.9.0 artifact — now with a platform list Hangar accepts:That attaches the JAR to the existing v2.9.0 release, publishes to Hangar and Modrinth, and uploads the SBOM. No new version number, no moved tag.
This has to happen before the next release PR merges — once release-please bumps
mainto 2.9.1, the version guard will correctly refuse the v2.9.0 dispatch.Verification
./gradlew buildpasses. The generated run tasks are nowrun-26.1,run-26.1.1,run-26.1.2,run-26.2— no morerun-26.0.