Skip to content

ci: publish packages from GitHub Releases - #1149

Merged
leoafarias merged 6 commits into
mainfrom
ci/automatic-package-releases
Nov 25, 2026
Merged

leoafarias merged 6 commits into
mainfrom
ci/automatic-package-releases

Conversation

@leoafarias

@leoafarias leoafarias commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Prepare version bumps with Prepare release, then make a GitHub Release public with a new <pkg>-v<version> tag on main. The tag push, not a Release event or a dispatch, triggers Publish to pub.dev. No automatic tags on merge.
  • Validate the package, pubspec version, exact changelog link, and ancestry on main using the tag's commit before the existing Production approval gate. Preserve dependency checks and first-publication exceptions.
  • After the package is on pub.dev, sync Release flags or make an existing draft public without editing notes. Only the highest stable mix version can take the Latest badge; other releases restore it to the newest public stable mix Release. If a tag has no Release, create one with a pub.dev link and generated notes against the preceding same-package tag (stable-to-stable for stable versions), when available.
  • Changes the CHANGELOG format for new releases: the version heading links to its GitHub Release. The release PR includes the draft notes (at most 60,000 characters), and the step summary has the full copyable Markdown. Older entries are not rewritten. The GitHub Release is the source of truth for notes.
  • Keep the complete release process in RELEASING.md. Use release for the full process and publish for the pub.dev step.

Required before merge

  • This changes the release process and needs Leo Farias's approval before merge. No change to pub.dev's tag-push OIDC settings is needed.

Configuration changes

  • .github/workflows/publish.yml: stays on tag pushes. Adds validate with contents: read and a queued github-release job with only contents: write. Existing publish and dependency-check permissions are unchanged.
  • .github/workflows/prepare-release.yml (renamed from changelog.yml): pins the repo's Melos version, passes inputs as environment variables, and prepares link-only entries and draft notes before opening the release PR. Declares contents: write and pull-requests: write for branch pushes and PR creation.
  • Removed .github/workflows/release.yml from the previous PR revision. There is no auto-tagging workflow or actions: write permission in this PR.

Validation

  • Checked workflow YAML and actionlint (v1.7.12 does not recognize GitHub's concurrency.queue key); Dart formatting and analysis; dart run scripts/check_publish_workflow.dart (including release script tests); git diff --check.
  • Ran validation and Release sync from a fresh clone with standalone Dart and mocked GitHub API calls. Covered annotated and missing tags, preserving draft notes, Latest restoration, lookup errors, and same-package stable comparisons.
  • Exercised Prepare release with real Melos and a local remote, and separately tested literal dispatch inputs, PR truncation, and fenced raw Markdown. Verified local links to the renamed guide and workflow. No production tags or pub.dev publishing were triggered.

@github-actions github-actions Bot added the repo label Nov 23, 2026
@leoafarias leoafarias self-assigned this Nov 23, 2026
@leoafarias leoafarias changed the title ci: create tags and GitHub Releases automatically ci: publish packages from GitHub Releases Nov 23, 2026
@leoafarias

Copy link
Copy Markdown
Collaborator Author

Final review of be6e967.

  1. scripts/check_publish_workflow.dart passes locally, including the release script tests.
  2. Every publish_<pkg> job needs validate, which checks that the tag, pubspec and changelog agree and that the tagged commit is on main. The first-publication exceptions for mix_protocol and mix_markdown are kept.
  3. github-release runs only when at least one publish succeeded and none failed, so skipped package jobs do not block it.
  4. queue: max on the github-release concurrency group is valid syntax.
  5. Behavior change to note: validate-tag requires the tagged version's changelog section to contain only the Release link. Re-running an existing tag such as mix-v2.5.0 now fails validation. RELEASING.md documents this.

All CI checks pass, and the branch merges cleanly with main.

VERDICT: MERGE

@leoafarias
leoafarias merged commit 02d3aba into main Nov 25, 2026
15 of 17 checks passed
@leoafarias
leoafarias deleted the ci/automatic-package-releases branch November 25, 2026 02:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant